Re: Factoring where clauses through UNIONS take 2 - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Factoring where clauses through UNIONS take 2
Date
Msg-id 20030424103054.F2131-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Factoring where clauses through UNIONS take 2  (Jonathan Bartlett <johnnyb@eskimo.com>)
Responses Re: Factoring where clauses through UNIONS take 2  (Jonathan Bartlett <johnnyb@eskimo.com>)
List pgsql-general
On Thu, 24 Apr 2003, Jonathan Bartlett wrote:

> Okay, after upgrading Postgres to 7.3.2, I got some improvements to my
> query through factoring, but it was obvious my tables needed a little
> help.  Therefore, I've modified my base tables and views, and now, even
> with enable_seqscan=off, it's not factoring through.  Here is my query:
>
> select * from all_actions where campaign = 3;
>
> The full query plan is at the end of the email.  Basically, all_actions is
> a view of several tables, each of which either have a field called
> "campaign" or "cached_campaign".  It is indexed for all affected tables.
> However, for every table it does a sequential scan rather than an indexed
> scan.  Any ideas on how to get it to at least attempt an indexed scan?

What does the actual view look like?  It seems to be pushing campaign=3
into a scan of campaign_sent_mails (although it's using a different index
on that).


pgsql-general by date:

Previous
From: "David Olbersen"
Date:
Subject: ODBC & Access [Try 2]
Next
From: Jonathan Bartlett
Date:
Subject: Re: Factoring where clauses through UNIONS take 2