Re: [SQL] PG7.4.5: query not using index on date column

2004-11-29 Thread Dave Steinberg
Sorry for the delay in getting back on this thread, painting my apartment meant no internet over this thanksgiving break... :) How many rows in the table altogether? A rough guess is a few million based on the estimated seqscan cost. That would mean that this query is retrieving about 10% of t

Re: [SQL] PG7.4.5: query not using index on date column

2004-11-25 Thread Tom Lane
Dave Steinberg <[EMAIL PROTECTED]> writes: >-> Seq Scan on messages (cost=0.00..21573.04 rows=436426 > width=54) (actual time=5.523..6304.657 rows=462931 loops=1) > Filter: ((received_date >= '2004-11-01'::date) AND > (received_date <= '2004-11-30'::date))

[SQL] PG7.4.5: query not using index on date column

2004-11-25 Thread Dave Steinberg
Hi Folks, I was hoping someone could help me to improve the performance of a query I've got that insists on doing a seq. scan on a large table. I'm trying to do some reporting based on my spam logs which I've partly digested and stored in a table. Here are the particulars: The messages table: