Re: Factoring where clauses through UNIONS take 2

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Factoring where clauses through UNIONS take 2
Date: 2003-04-24 17:33:35
Message-ID: 20030424103054.F2131-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Bartlett 2003-04-24 17:41:59 Re: Factoring where clauses through UNIONS take 2
Previous Message David Olbersen 2003-04-24 17:21:31 ODBC & Access [Try 2]