Skip site navigation (1) Skip section navigation (2)

SELECT * FROM <table> LIMIT 1; is really slow

From: David Blasby <dblasby(at)refractions(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: SELECT * FROM <table> LIMIT 1; is really slow
Date: 2004-05-26 21:00:47
Message-ID: 40B5057F.2000007@refractions.net (view raw or flat)
Thread:
Lists: pgsql-hackers
I have a table with about 16,000,000 rows in it.

When I do a:

SELECT * FROM <table> LIMIT 1;

it takes about 10 minutes (thats about how long it takes to do a full 
sequential scan).

I had originally thought that there might be a large number of 
"wasted/retired" tuples in the table so I "vacuum analysed" the 
database.  It had no effect.  I had a "vacuum full" going on the table 
for 17 hours before I killed it.

Any idea why its so slow? It used to be instant.

dave



Responses

pgsql-hackers by date

Next:From: Gaetano MendolaDate: 2004-05-26 21:17:08
Subject: Re: SELECT * FROM <table> LIMIT 1; is really slow
Previous:From: Tom LaneDate: 2004-05-26 20:33:31
Subject: Re: tablespaces and DB administration

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group