pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Wayne Conrad <wayne@databill.com>
To: pgsql-performance@postgresql.org
Subject: Re: 8.4.7, incorrect estimate
Date: Fri, 29 Apr 2011 14:12:44 -0500
Message-ID: <4DBAC75C020000250003D06B@gw.wicourts.gov> (raw)
In-Reply-To: <4DBB024B.5050500@databill.com>
References: <4DBB024B.5050500@databill.com>

Wayne Conrad <wayne@databill.com> wrote:
 
> select page_number, ps_id, ps_page_id from ps_page where
> ps_page_id in (select ps_page_id from documents_ps_page where
> document_id in (select document_id from temp_doc_ids)) order by
> ps_page_id;
 
> [estimated rows=34398932; actual rows=5]
 
> We tried increasing (from 100 to 1,000 and 10,000) the statistics
> targets for each of the indexed columns, one at a time, and
> analyzing the table/column with each change.  This had no effect
 
Ouch.
 
Out of curiosity, what do you get with?:
 
explain analyze
select
    page_number,
    ps_id,
    ps_page_id
  from ps_page p
  where exists
        (
          select * from documents_ps_page d
            where d.ps_page_id = p.ps_page_id
              and exists
                  (select * from temp_document_ids t
                     where t.document_id = d.document_id)
        )
  order by ps_page_id
;
 
-Kevin



view thread (8+ messages)  latest in thread

Message-ID: <4DBAC75C020000250003D06B@gw.wicourts.gov>
Permalink:  ../4DBAC75C020000250003D06B@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4DBAC75C020000250003D06B@gw.wicourts.gov

 · 

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: Kevin.Grittner@wicourts.gov, wayne@databill.com
  Subject: Re: 8.4.7, incorrect estimate
  In-Reply-To: <4DBAC75C020000250003D06B@gw.wicourts.gov>

* 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