Re: [SQL] timestamp query doesn't use an index ...

2006-05-21 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > -> Bitmap Heap Scan on page_schedule ps2 (cost=573.65..2822.86 > rows=91614 width=16) (actual time=149.788..505.438 rows=94798 loops=1) > Recheck Cond: (timezone('MST7MDT'::text, start_time) <= '2006-05-17 > 08:09:18'::timestamp wit

Re: [SQL] timestamp query doesn't use an index ...

2006-05-21 Thread Marc G. Fournier
On Sun, 21 May 2006, Tom Lane wrote: "Marc G. Fournier" <[EMAIL PROTECTED]> writes: I'm trying to figure out some way to speed up the following query: select ps2.page_id, ps2.template_component_id, max(ps2.start_time) from page_schedule ps2 where ps2.start_time at time zone 'MST7

Re: [SQL] timestamp query doesn't use an index ...

2006-05-21 Thread Tom Lane
"Marc G. Fournier" <[EMAIL PROTECTED]> writes: > I'm trying to figure out some way to speed up the following query: >select ps2.page_id, ps2.template_component_id, max(ps2.start_time) > from page_schedule ps2 > where ps2.start_time at time zone 'MST7MDT' <= '2006-5-17 8:9:18' > group

Re: [SQL] timestamp query doesn't use an index ...

2006-05-20 Thread Marc G. Fournier
On Sun, 21 May 2006, Michael Glaesemann wrote: On May 21, 2006, at 10:42 , Marc G. Fournier wrote: -> Seq Scan on page_schedule ps2 (cost=0.00..2364.95 rows=33110 width=16) (actual time=0.021..623.363 rows=94798 loops=1) I don't know about rewriting the query, but it appears your statis

Re: [SQL] timestamp query doesn't use an index ...

2006-05-20 Thread Michael Glaesemann
On May 21, 2006, at 10:42 , Marc G. Fournier wrote: -> Seq Scan on page_schedule ps2 (cost=0.00..2364.95 rows=33110 width=16) (actual time=0.021..623.363 rows=94798 loops=1) I don't know about rewriting the query, but it appears your statistics are a little out of date (e.g., rows exp

[SQL] timestamp query doesn't use an index ...

2006-05-20 Thread Marc G. Fournier
I'm trying to figure out some way to speed up the following query: select ps2.page_id, ps2.template_component_id, max(ps2.start_time) from page_schedule ps2 where ps2.start_time at time zone 'MST7MDT' <= '2006-5-17 8:9:18' group by ps2.page_id, ps2.template_component_id When run throug