Re: Slow count(*) again...

From: bricklen <bricklen(at)gmail(dot)com>
To: Neil Whelchel <neil(dot)whelchel(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow count(*) again...
Date: 2010-10-12 15:12:53
Message-ID: AANLkTimXSWapozrZNdiRXDSm2hdsha1As94NwuS967As@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Sat, Oct 9, 2010 at 4:26 PM, Neil Whelchel <neil(dot)whelchel(at)gmail(dot)com> wrote:
> Maybe an
> estimate(*) that works like count but gives an answer from the index without
> checking visibility? I am sure that this would be good enough to make a page
> list, it is really no big deal if it errors on the positive side, maybe the
> list of pages has an extra page off the end. I can live with that. What I
> can't live with is taking 13 seconds to get a page of results from 850,000
> rows in a table.
> -Neil-
>

FWIW, Michael Fuhr wrote a small function to parse the EXPLAIN plan a
few years ago and it works pretty well assuming your stats are up to
date.

http://markmail.org/message/gknqthlwry2eoqey

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-10-12 15:29:22 Re: Slow count(*) again...
Previous Message Alvaro Herrera 2010-10-12 14:51:58 Re: Debugging initdb breakage

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2010-10-12 15:29:22 Re: Slow count(*) again...
Previous Message Kevin Grittner 2010-10-12 15:11:29 Re: How does PG know if data is in memory?