in reply to Re^2: 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)

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

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

Replies are listed 'Best First'.
Re^4: Bitten by the worst case (or why it pays to know whats inside the black box)
by demerphq (Chancellor) on Jun 27, 2004 at 15:42 UTC

    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