Forum OpenACS Development: Response to ACS 4.x won't scale (I hope I am wrong)

Collapse
Posted by Don Baccus on
Try it!  Also ... Oracle may be smart enough to not count all rows if you're comparing with 0, but Postgres is not.  In a Postgres form of this query we really want to use "exists".  I've not bothered when porting the APM because it's not used all that often and the number of packages and versions will grow over time perhaps to the hundreds, but  not to the tens of thousands.

But for any check on a sizable table, "exists" is the way to go in Postgres.  It's considerably faster in the "true" case, for all practical cases the same in the "false" case as counting.