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

From ryan.a.roemmich@mail.sprint.com
Subject RE: index skipped in favor of seq scan.
Date
Msg-id H0001cb70b98181f.0994776942.kcopmp06@MHS
Whole thread Raw
In response to index skipped in favor of seq scan.  (ryan.a.roemmich@mail.sprint.com)
Responses Re: index skipped in favor of seq scan.  (Tom Lane <tgl@sss.pgh.pa.us>)
Foreign Keys  (Ryan Mahoney <ryan@paymentalliance.net>)
List pgsql-general
On the other end of the spectrum there are many addresses with only one
entry.  When I use one of these addresses in the WHERE clause it takes
just as long as the address with 150k rows.  If the sequential scan is
better for 150k rows out of 800k rows, what about 1 out of 800k?  It
seems that when my table grew to this size the index was no longer used.
 If that's true is there any point in having the index?

-----Original Message-----
From: peter.e [mailto:peter_e@gmx.net]
Sent: Monday, July 09, 2001 4:26 PM
To: ryan.a.roemmich
Cc: pgsql-general
Subject: Re: [GENERAL] index skipped in favor of seq scan.


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


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Partial indicies again
Next
From: Fernando Schapachnik
Date:
Subject: TCL and encoding