Re: Unexpected query plan results

From: "Dave Dutcher" <dave(at)tridecap(dot)com>
To: "'Anne Rosset'" <arosset(at)collab(dot)net>, "'Robert Haas'" <robertmhaas(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Unexpected query plan results
Date: 2009-06-01 21:07:01
Message-ID: 24448D36F8754ECEB66FC54EB9641623@tridecap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> -----Original Message-----
> From: Anne Rosset
> Subject: Re: [PERFORM] Unexpected query plan results
>
> >>
> >>SELECT SUM(1) FROM item WHERE is_deleted = 'f'; sum
> --------- 1824592
> >>(1
> >>row)
> >>SELECT SUM(1) FROM item WHERE folder_id = 'tracker3641
> >></sf/sfmain/do/go/tracker3641?returnUrlKey=1243878161701>'; sum
> >>--------
> >>122412 (1 row)
> >>SELECT SUM(1) FROM item WHERE folder_id = 'tracker3641
> >></sf/sfmain/do/go/tracker3641?returnUrlKey=1243878161701>' AND
> >>is_deleted = 'f'; sum ----- 71 (1 row) SELECT SUM(1) FROM
> item WHERE
> >>folder_id = 'tracker3641
> >></sf/sfmain/do/go/tracker3641?returnUrlKey=1243878161701>' AND
> >>is_deleted = 't'; sum -------- 122341 (1 row)
> >>
> >>
> >
> >Something's not right here. If the whole table has only
> 468173 rows,
> >you can't have 1.8 million deleted rows where is_deleted = false.
> >
> >...Robert
> >
> >
> The item table has 2324829 rows
> The artifact table has 468173 rows.
> Thanks,
> Anne

I'd been thinking about the sort, but I hadn't thought yet if that index
scan on item could be made faster. Could you post the table definition of
item including the indexes on it?

Dave

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Anne Rosset 2009-06-01 21:10:25 Re: Unexpected query plan results
Previous Message Anne Rosset 2009-06-01 20:53:24 Re: Unexpected query plan results