Re: index skipped in favor of seq scan. - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: index skipped in favor of seq scan.
Date
Msg-id Pine.LNX.4.30.0107092324550.677-100000@peter.localdomain
Whole thread Raw
In response to index skipped in favor of seq scan.  (ryan.a.roemmich@mail.sprint.com)
List pgsql-general
ryan.a.roemmich@mail.sprint.com writes:

> I am working with putting syslog logs into a database, I'm parsing the
> logs and using the key information for my fields.  With my test data of
> ~200K rows the optimizer used my b-tree index that I created for an
> oft-used where clause.  When the table grew to over 800K rows the index
> was no longer used.  The field in question contains IP addresses, but
> uses varchar.  The values are _not_ unique.  One particular address has
> 150K entries.  How can I keep my where queries speedy?

For 150k out of 800k rows, a sequential scan is definitely the better
choice.  If you can prove otherwise, please post data.

For problems with the optimizer in general you should post the schema, the
queries, and the explain output.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: dump
Next
From: Peter Eisentraut
Date:
Subject: Re: ODBC 3.0 functions (UCASE, LCASE, etc.)