Re: Indexing UNIONs - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Indexing UNIONs
Date
Msg-id 200207151731.24567.josh@agliodbs.com
Whole thread Raw
In response to Re: Indexing UNIONs  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Indexing UNIONs  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Indexing UNIONs  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
Stephan,

> We had a discussion recently on -general about this.  Right now the
> planner won't push the conditions down into the arms of the union because
> noone's been sure under what conditions the optimization is safe.

So, if performance is horrible with the view, I should use a dummy table to
hold the Unioned data and index that instead?

I can understand the difficultyof optimization.  However, the example I
supplied is the simplest of unions, and the two Seq Scans do seem to be
proceeding against each table seperately.   I think for very simple Unions
(i.e. no grouping, no filtering within subqueries, etc.) that index usage
would be reasonable to implement.

However, I can't program it myself, so I'll have to just stick to whining and
pitiful pleading <blink puppy-dog eyes, sniffle>

--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Jie Liang
Date:
Subject: pg_restore --flag
Next
From: Stephan Szabo
Date:
Subject: Re: Indexing UNIONs