Re: index skipped in favor of seq scan.

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <ryan(dot)a(dot)roemmich(at)mail(dot)sprint(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: index skipped in favor of seq scan.
Date: 2001-07-09 21:26:25
Message-ID: Pine.LNX.4.30.0107092324550.677-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ryan(dot)a(dot)roemmich(at)mail(dot)sprint(dot)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(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-07-09 21:27:32 Re: ODBC 3.0 functions (UCASE, LCASE, etc.)
Previous Message Peter Eisentraut 2001-07-09 21:23:35 Re: dump