Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Bitten by the worst case (or why it pays to know whats inside the black box)

by demerphq (Chancellor)
on Jun 26, 2004 at 23:41 UTC ( [id://369894]=note: print w/replies, xml ) Need Help??


in reply to Re: Bitten by the worst case (or why it pays to know whats inside the black box)
in thread Bitten by the worst case (or why it pays to know whats inside the black box)

Hmm. Some interesting thoughts here. I can't use the queries as part of the problem is that the results for different queries can be the same. Although its only implied these are lists of Prefix=>Zone Assignments for customers. So two customers may have the same assigments. I think instead of merging the lists. (which isnt that terrible an idea BTW) I might actually rework the way the queries are executed so I can do the union of the four in a single query and let the DB sort it. The last idea certainly is an interesting approach to avoiding the shuffle.

Thanks for the brainfood. :-)


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


  • Comment on Re^2: Bitten by the worst case (or why it pays to know whats inside the black box)

Replies are listed 'Best First'.
Re^3: Bitten by the worst case (or why it pays to know whats inside the black box)
by mpeppler (Vicar) on Jun 27, 2004 at 15:36 UTC
    In general, if you can let the database do the sorting/merging of the four queries it is likely to be faster (after all, that's what a database server is optimized to do!).

    There may of course be situations where trying to get the database to do the right thing requires too much shoe-horning of the data to be worth it...

    Michael

      Yeah I reckon so as well. In fact between the various responses I've received I reckon there are a few different optimisations that can be had for cheap. I look forward to trying them out tomorrow.


      ---
      demerphq

        First they ignore you, then they laugh at you, then they fight you, then you win.
        -- Gandhi


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://369894]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2024-04-25 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found