Re: Searching for the cause of a bad plan - Mailing list pgsql-performance

From Csaba Nagy
Subject Re: Searching for the cause of a bad plan
Date
Msg-id 1190982832.5430.94.camel@PCD12478
Whole thread Raw
In response to Re: Searching for the cause of a bad plan  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-performance
> Just an idea, but with the 8.3 concurrent scan support would it be
> possible to hang a more in depth analyze over exisiting sequential
> scans. Then it would be a lower cost to have higher resolution in
> the statistics because the I/O component would be hidden.

The biggest problem with that is that it wouldn't be deterministic...
the table in question from my original post is never scanned
sequentially in normal operation. The other way around is also possible,
when sequential scans are too frequent, in that case you wouldn't want
to also analyze all the time. So there would be a need for logic of when
to analyze or not with a sequential scan and when do it proactively
without waiting for one... and I'm not sure it will be worth the
complexity.

I think it would me much more productive if some "long running query"
tracking combined with a "background planner" thread would do targeted
analyzes for specific correlations/distributions/conditions based on
what queries are actually running on the system.

Cheers,
Csaba.



pgsql-performance by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Searching for the cause of a bad plan
Next
From: "Merlin Moncure"
Date:
Subject: Re: Tuning for warm standby