On Mon, 12 Nov 2001, Jeff Boes wrote: > In article <[EMAIL PROTECTED]>, > "Stephan Szabo" <[EMAIL PROTECTED]> wrote: > > > How many rows are in the table? Have you run vacuum analyze? > > Sorry, that information was in the original post, but perhaps you missed > it: > > In article <9shhnf$23ks$[EMAIL PROTECTED]>, "Jeff Boes" <[EMAIL PROTECTED]> > wrote: > > > We have a table which has approximately 400,000 rows. It has 17 columns, > > and 4 indexes. The primary key is a int4 (filled by a sequence), > > additionally we have two more int4 indexes and a timestamp index. > > Yes, VACUUM ANALYZE gets run every 24 hours, and currently the table > grows by some 25K-40K rows per day. Could a factor be the time elapsed > between the VACUUM and the query?
Is the 40000 row estimate for the number selected correct? If so, then index scan may very well be a losing plan for this query. Does the forced index scan actually take less time than the the sequence scan? ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])