Re: CREATE INDEX speeds up query on 31 row table ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CREATE INDEX speeds up query on 31 row table ...
Date
Msg-id 24368.1096570608@sss.pgh.pa.us
Whole thread Raw
In response to Re: CREATE INDEX speeds up query on 31 row table ...  (Greg Stark <gsstark@mit.edu>)
Responses Re: CREATE INDEX speeds up query on 31 row table ...
Re: CREATE INDEX speeds up query on 31 row table ...
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> You say it's "*very* busy" is it possible there are hundreds or thousands of
> tuples in there that are uncommitted or committed after this query starts?

More specifically, I bet there's a huge number of completely empty
pages, which would be read by a seqscan but not an indexscan.  VACUUM
FULL should fix it nicely, but it's odd that autovacuum isn't keeping
a lid on the file size.  Maybe with so few live rows, it's confused into
thinking it doesn't need to vacuum the table often?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: FlushRelationBuffers error
Next
From: Tom Lane
Date:
Subject: Re: SIGABRT on 7.4.5