Sequential Scans

From: Ericson Smith <eric(at)did-it(dot)com>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Sequential Scans
Date: 2003-03-06 21:15:48
Message-ID: 1046985347.8422.13.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a table with about 3.2 Million records.

There is one process that I run that needs to process batches of records
1000 at a time out of a set of approximately 220,000 records.

So my query looks like this:
SELECT a.*, b.url FROM listings a, urls b WHERE a.urlindex=b.index AND
a.haslid=1 ORDER BY a.index LIMIT 1000 OFFSET 0;

Doing the above query with an offset of up to 5000 (the 5th batch) shows
(with EXPLAIN) that index scans are being used.

Exceeding an OFFSET of 5000 produces sequential scans. The whole process
goes horribly slow at that point.

Any suggestions as to what may be causing this?

My environment:
* RH 7.3 // Postgresql 7.3.x // Latest Kernel from RH
* RAM 6 Gigs
* Dual Xeon CPU's
* Shared Ram 250MB
* VACUUM / ANALYZE run twice per day
* The tables in question are mostly static (.05% updates, 1% inserts
daily)

- Ericson Smith
eric(at)did-it(dot)com

--
Ericson Smith <eric(at)did-it(dot)com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom 2003-03-06 21:18:04 Re: first crash
Previous Message Tom Lane 2003-03-06 21:08:00 Re: first crash