![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I vaguely remember seeing that PostgresSQL optimized selects on certain UNION ALL statements, so that given: CREATE VIEW orders AS SELECT '2003-01' as period, * FROM orders_2003_01 UNION ALL SELECT '2003-02' as period, * FROM orders_2003_02 then SELECT * FROM orders WHERE period = '2003-01' would do a full table scan only on the orders_2003_01 table. But I didn't see this optimization while I was running some tests against 7.4.2. Am I missing something now? Or am I just mis-remembering Postgres' behavior? |
![]() |
| Thread Tools | |
| Display Modes | |
| |