Re: Poor performance on seq scan - Mailing list pgsql-performance

From Guillaume Cottenceau
Subject Re: Poor performance on seq scan
Date
Msg-id 87y7spw8v9.fsf@meuh.mnc.lan
Whole thread Raw
In response to Re: Poor performance on seq scan  (Laszlo Nagy <gandalf@designaproduct.biz>)
Responses Re: Poor performance on seq scan  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-performance
Laszlo Nagy <gandalf 'at' designaproduct.biz> writes:

> > Probably, but PostgreSQL doesn't know how to do that. Even if it
> > did, it depends on how many matches there is. If you scan the index
> > and then fetch the matching rows from the heap, you're doing random
> > I/O to the heap. That becomes slower than scanning the heap
> > sequentially if you're going to get more than a few hits.
> I have 700 000 rows in the table, and usually there are less than 500
> hits. So probably using a "seq index scan" would be faster. :-) Now I

You can confirm this idea by temporarily disabling sequential
scans. Have a look at this chapter:

http://www.postgresql.org/docs/7.4/interactive/runtime-config.html#RUNTIME-CONFIG-QUERY

--
Guillaume Cottenceau
Create your personal SMS or WAP Service - visit http://mobilefriends.ch/

pgsql-performance by date:

Previous
From: Guillaume Cottenceau
Date:
Subject: Re: Poor performance on seq scan
Next
From: Heikki Linnakangas
Date:
Subject: Re: Poor performance on seq scan