pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannes Dorbath <light@theendofthetunnel.de>
To: pgsql-performance@postgresql.org
Subject: Yet another question on LIMIT performance :/
Date: Mon, 06 Nov 2006 15:13:10 +0100
Message-ID: <einfmm$r41$1@news.hub.org> (raw)

Though I've read recent threads, I'm unsure if any matches my case.

We have 2 tables: revisions and revisions_active. revisions contains 
117707 rows, revisions_active 17827 rows.

DDL: http://hannes.imos.net/ddl.sql.txt

Joining the 2 tables without an additional condition seems ok for me 
(given our outdated hardware): http://hannes.imos.net/query_1.sql.txt

What worries me is the performance when limiting the recordset:
http://hannes.imos.net/query_2.sql.txt

Though it should only have to join a few rows it seems to scan all rows. 
 From experience I thought that adding an ORDER BY on the index columns 
should speed it up. But no effect: http://hannes.imos.net/query_3.sql.txt

I'm on 8.1.5, statistics (ANALYZE) are up to date, the tables have each 
been CLUSTERed by PK, statistic target for the join columns has been set 
to 100 (without any effect).


Thanks in advance!


-- 
Regards,
Hannes Dorbath



view thread (4+ messages)  latest in thread

Message-ID: <einfmm$r41$1@news.hub.org>
Permalink:  ../einfmm$r41$1@news.hub.org/
Also on:    postgresql.org/message-id/einfmm$r41$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: light@theendofthetunnel.de
  Subject: Re: Yet another question on LIMIT performance :/
  In-Reply-To: <einfmm$r41$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox