Re: performance on selecting a row in large tables

From: Tino Schwarze <postgresql(at)tisc(dot)de>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: performance on selecting a row in large tables
Date: 2008-02-04 21:20:50
Message-ID: 20080204212050.GA17045@easy2.in-chemnitz.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Rainer,

On Tue, Feb 05, 2008 at 09:07:26AM +1300, Rainer Spittel wrote:

> When performing a 'select col01_id from table limit 1 offset 100000;',

As Tom already stated, the result of this query is a bit random since
there is no ordering at all. What are you actually querying for?

Try tuning queries before tuning the server.

> Looking forward for any comments or suggestions.

Here it is, right at the bottom of your mail:

> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

explain analyze select col01_id from table limit 1 offset 100000;
will run the query and show you how the query plan looks and how much
time is spent. It is likely to say "SeqScan" somewhere - a sequential
scan of the tabe.

HTH!

Tino.

--
www.craniosacralzentrum.de
www.spiritualdesign-chemnitz.de

Tino Schwarze * Lortzingstraße 21 * 09119 Chemnitz

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rainer Spittel 2008-02-04 21:24:11 Re: performance on selecting a row in large tables
Previous Message Tom Lane 2008-02-04 20:39:25 Re: performance on selecting a row in large tables