Re: CREATE INDEX speeds up query on 31 row table ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: CREATE INDEX speeds up query on 31 row table ...
Date: 2004-09-30 18:56:48
Message-ID: 24368.1096570608@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-09-30 19:03:24 Re: SIGABRT on 7.4.5
Previous Message Greg Stark 2004-09-30 18:30:13 Re: CREATE INDEX speeds up query on 31 row table ...