From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: pgsql-performance@postgresql.org
Subject: Re: speed up query with max() and odd estimates
Date: Tue, 26 Apr 2005 22:48:53 +0200
Message-ID: <20050426204853.GA29424@uio.no> (raw)
In-Reply-To: <f3c0b40805042613167c47c7e9@mail.gmail.com>
References: <f3c0b40805042613167c47c7e9@mail.gmail.com>
On Tue, Apr 26, 2005 at 03:16:57PM -0500, Matthew Nuzum wrote:
> Seq Scan on usage_access (cost=0.00..1183396.40 rows=12713851
> width=116) (actual time=481796.22..481839.43 rows=3343 loops=1)
That's a gross misestimation -- four orders of magnitude off!
Have you considering doing this in two steps, first getting out whatever
comes from the subquery and then doing the query? Have you ANALYZEd recently?
Do you have an index on atime?
/* Steinar */
--
Homepage: http://www.sesse.net/
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: sgunderson@bigfoot.com
Subject: Re: speed up query with max() and odd estimates
In-Reply-To: <20050426204853.GA29424@uio.no>
* 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