Re: performance on selecting a row in large tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rainer Spittel" <rainer(dot)spittel(at)terralink(dot)co(dot)nz>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: performance on selecting a row in large tables
Date: 2008-02-04 20:39:25
Message-ID: 7905.1202157565@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Rainer Spittel" <rainer(dot)spittel(at)terralink(dot)co(dot)nz> writes:
> When performing a 'select col01_id from table limit 1 offset 100000;',
> the query takes up to 20sec. Monitoring the dstats on the server, I see
> that the box is reading approx. 1GB from the disks.

No surprise. That query says "read 100001 rows, then throw away the
first 100000".

Why are you considering that this is an important performance measure?
Are you aware that the results of such a query aren't even very well
defined (since you omitted an ORDER BY)?

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tino Schwarze 2008-02-04 21:20:50 Re: performance on selecting a row in large tables
Previous Message Rainer Spittel 2008-02-04 20:07:26 performance on selecting a row in large tables