Re: Bad Plan for Questionnaire-Type Query - Mailing list pgsql-performance

From David Blewett
Subject Re: Bad Plan for Questionnaire-Type Query
Date
Msg-id 9d1f8d830906051453x26ccb3dfif7fd103409e1347c@mail.gmail.com
Whole thread Raw
In response to Re: Bad Plan for Questionnaire-Type Query  (David Blewett <david@dawninglight.net>)
Responses Re: Bad Plan for Questionnaire-Type Query  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
On Mon, May 25, 2009 at 11:22 AM, David Blewett <david@dawninglight.net> wrote:
> On Sun, May 24, 2009 at 2:42 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> It still feels like this schema design is obscuring correlations that
>> the planner needs to know about in order to make decent estimates.
>
> I'm not sure how to make the planner aware of these correlations. Is there
> something inherently flawed with this design? It seems pretty close to the
> one on the Varlena website [1].
>
>> You mentioned earlier that the seemingly unrelated question_ids were
>> linked via a common submission_id.  I wonder whether it's possible to
>> query using the submission_id instead?
>
> Well, I do join the different response tables [text/date/etc] together via
> the submission_id. However, in order to be able to apply the where clauses
> appropriately, I have to limit the responses to the appropriate
> question_id's. Would it matter to push that requirement down to the where
> clause instead of part of the join clause?
>
> David
>
> 1. http://www.varlena.com/GeneralBits/110.php
>

Anyone have thoughts on this?

Bueller?

David

pgsql-performance by date:

Previous
From: Robert Haas
Date:
Subject: Re: Scalability in postgres
Next
From: Josh Berkus
Date:
Subject: Re: Bad Plan for Questionnaire-Type Query