Re: [HACKERS] Query not using index, please explain.

2001-03-09 Thread Tom Lane
Richard Poole [EMAIL PROTECTED] writes: [ snip a bunch of commentary about optimizer statistics ] Can someone who really knows this stuff (Tom?) step in if what I've just said is completely wrong? Looked good to me. select domain from history_entries group by domain; To me, since there

[HACKERS] Query not using index, please explain.

2001-03-08 Thread Matthew Hagerty
Greetings, I have a real simple table with a timestamp field. The timestamp field has an index on it. But, the index does not seem to be taken into account for selects that return rows: pglog=# explain select time_stamp from history_entries where time_stamp '03-01-2000'; NOTICE: QUERY

Re: [HACKERS] Query not using index, please explain.

2001-03-08 Thread Matthew Hagerty
Richard, Thanks for the response, I guess I should have included a little more information. The table contains 3.5 million rows. The indexes were created after the data was imported into the table and I had just run vacuum and vacuum analyze on the database before trying the queries and

Re: [HACKERS] Query not using index, please explain.

2001-03-08 Thread Tom Lane
Matthew Hagerty [EMAIL PROTECTED] writes: The query where the time_stamp '03-01-2000' does not return any rows, the 04-01-2000 date does return rows. When I disable seqscan the query is almost instant, but with it on, it takes about 3 or 4 minutes. Why can't the query planner use the

Re: [HACKERS] Query not using index, please explain.

2001-03-08 Thread Richard Poole
On Thu, Mar 08, 2001 at 02:43:54PM -0500, Matthew Hagerty wrote: Richard, Thanks for the response, I guess I should have included a little more information. The table contains 3.5 million rows. The indexes were created after the data was imported into the table and I had just run