Re: 8.4.7, incorrect estimate - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: 8.4.7, incorrect estimate
Date
Msg-id 4DBAC75C020000250003D06B@gw.wicourts.gov
Whole thread Raw
In response to 8.4.7, incorrect estimate  (Wayne Conrad <wayne@databill.com>)
Responses Re: 8.4.7, incorrect estimate
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Greg Smith
Date:
Subject: Re: FUSION-IO io cards
Next
From: Joachim Worringen
Date:
Subject: Re: FUSION-IO io cards