On Fri, Oct 14, 2005 at 09:43:57AM -0400, John D. Burger wrote: > (By the way, gazPlaces.gazPlaceID below is a primary key, so should be > unique - I think that's required for these to be equivalent. I tested > the two queries on small data sets, and they do indeed return the same > results.) I think that you also have to be sure that gazPlaceID is never NULL. AFAIK the PostgreSQL doesn't track that sort of thing at all at the planning/optimisation stage. You're right, sometimes statements are equivalent but usually there is some corner case (like NULLs, duplicate values, etc) that screw it up for the general case. Teaching the planner all that is something not yet done. Have a nice day, -- Martijn van Oosterhout <kleptog@xxxxxxxxx> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
Attachment:
pgpZYBF2uip1e.pgp
Description: PGP signature