DBI

Brendon Oliver brendon.oliver at redsheriff.com
Fri Apr 2 14:53:10 CST 2004


> There's a missing caveat here...  If you don't sort (ORDER BY) your select
> results then there isn't a lot of promise that items 40-50 won't
> necessarily be the same (coincidentally) as items 1-10.
> If you _do_ order your results then remember that items 40 - 50 are not
> necessarily the same as the items 40 - 50 of your original select as
> someone else may have added a few "earlier" items into the database since
> then - or removed them.

Absolutely!

> Also, if what you're selecting from my_table is very large, selecting it,
> sorting it and displaying a handful of results each time can put a lot of
> load on your system.  If this is an issue, and if you can afford to not
> show new items absolutely immediately, you may want to select without
> limit, pull out the bits you care about and cache the rest.  Every x
> seconds/minutes/hours (as appropriate) the entry in the cache expires and
> you do your select, sort and recache again.

Point taken.  Thankfully, in most places where I've had to do this, the
result set is not too large, so it's not been an issue for me.

Cheers,

- Brendon.



More information about the Melbourne-pm mailing list