Search Postgresql Archives

Re: Select Union

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

 



Randall Skelton <skelton@brutus.uwaterloo.ca> writes:
> As you suggested, while this is much shorter in length, it is 
> considerably longer in execution.

>> SELECT t1.timestamp FROM (
>> SELECT timestamp FROM cal_quat_1 UNION
>> SELECT timestamp FROM cal_quat_2 UNION
>> SELECT timestamp FROM cal_quat_3 UNION
>> SELECT timestamp FROM cal_quat_4 UNION
>> SELECT timestamp FROM cal_ccd_temp
>> ) t1 WHERE
>> t1.timestamp BETWEEN '2004-02-01 00:03:30' AND '2004-02-01 
>> 00:04:00';

Do you actually need UNION, or would UNION ALL do?  (The latter doesn't
try to eliminate duplicates.)

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[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