Re: PostgreSQL 9.0.1 on Windows performance tunning help please

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <hatuan05(at)gmail(dot)com>,<gwilliamson39(at)yahoo(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL 9.0.1 on Windows performance tunning help please
Date: 2011-08-06 16:07:38
Message-ID: 4E3D207A020000250003FBCD@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

[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

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-08-06 16:26:07 Re: PostgreSQL 9.0.1 on Windows performance tunning help please
Previous Message tuanhoanganh 2011-08-06 03:43:50 Re: PostgreSQL 9.0.1 on Windows performance tunning help please