From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: hatuan05@gmail.com
To: gwilliamson39@yahoo.com
Cc: pgsql-performance@postgresql.org
Subject: Re: PostgreSQL 9.0.1 on Windows performance tunning help please
Date: Sat, 06 Aug 2011 11:07:38 -0500
Message-ID: <4E3D207A020000250003FBCD@gw.wicourts.gov> (raw)
[Please don't top-post; it makes the discussion hard to follow.]
tuanhoanganh wrote:
> Greg Williamson wrote:
>> Did you run an analyze on the table after building the new
>> indexes? The row estimates seem to be off wildly, although that
>> may be a symptom of something else
I think that's because the optimizer doesn't know how to estimate the
range test properly, and resorts to "magic numbers" based on
percentages of the rows in the table.
> If i remove ORDER BY, the query run faster.
Yeah, it thinks there will be 26 billion rows, and that sorting that
would be very expensive. You really have only 76 thousand rows,
which wouldn't be so bad. I'm not sure whether this would work, but
if you need the ordering, you might try:
WITH x AS SELECT * FROM x ORDER BY d.data_id;
-Kevin
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, hatuan05@gmail.com, gwilliamson39@yahoo.com
Subject: Re: PostgreSQL 9.0.1 on Windows performance tunning help please
In-Reply-To: <4E3D207A020000250003FBCD@gw.wicourts.gov>
References: <4E3D207A020000250003FBCD@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