Search Postgresql Archives

Re: Performance of outer joins?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Benjamin Smith <ben@xxxxxxxxxxxxxxxxxx> writes:
> 	FROM customers 
> 	JOIN calendars ON 
> 		(
> 		-- GIVE A CALENDAR OF POSSIBLE DAYS FOR DELIVERIES 
> 		calendar.day < 20061201
> 		AND calendar.day >= 20060101
> 		) 

Haven't you written a cross-product join here?  Seems like a bad
idea if you'd like it to be fast.  Especially since you then left-joined
it to something else, meaning that every row in the cross product
must in fact generate output.  Do you really want to be deluged with
a table showing all the customers you DIDN'T deliver to on each day,
for every day in the year?

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux