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

From: Paul Ramsey <pramsey(at)refractions(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SELECT * FROM <table> LIMIT 1; is really slow
Date: 2004-05-27 03:55:15
Message-ID: 40B566A3.2090808@refractions.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> of dead tuples followed by a lot of pages worth of live tuples. Plain
> VACUUM cannot do much to fix this since it doesn't move rows around.
> VACUUM FULL will fix it, but its index-update overhead is high enough
> that CLUSTER is a better deal.

Tom: I was interested in performance improvements from cluster, so I
tried to cluster a table on a spatial index:

dra_working=# \d geomtest
Table "public.geomtest"
Column | Type | Modifiers
----------------+----------+-----------
rd_segment_id | integer |
admit_date | date |
retire_date | date |
most_recent | boolean |
lineargeometry | geometry |
Indexes: geomtest_idx gist (lineargeometry)

dra_working=# cluster geomtest_idx on geomtest;
ERROR: CLUSTER: cannot cluster when index access method does not handle
nulls
You may be able to work around this by marking column "lineargeometry"
NOT NULL
dra_working=# select version();
version
---------------------------------------
PostgreSQL 7.3.6 on i686-pc-linux-gnu

As of quite a while ago (7.2?) the GiST access method was made null-safe
by Teodor and Oleg, I think. Is this a safety wrapper left over from
before the upgrade to GiST?

--
__
/
| Paul Ramsey
| Refractions Research
| Email: pramsey(at)refractions(dot)net
| Phone: (250) 885-0632
\_

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2004-05-27 05:11:10 Re: Nested xacts: looking for testers and review
Previous Message James Robinson 2004-05-27 03:43:19 Re: tablespaces and DB administration