From: Bruno Wolff III <bruno@wolff.to>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Indexing UNIONs
Date: Wed, 17 Jul 2002 07:06:46 -0500
Message-ID: <20020717120646.GA5520@wolff.to> (raw)
In-Reply-To: <200207161542.23433.josh@agliodbs.com>
References: <20020716114553.GB29323@wolff.to>
<web-1578828@davinci.ethosmedia.com>
<20020716192006.GC32419@wolff.to>
<200207161542.23433.josh@agliodbs.com>
On Tue, Jul 16, 2002 at 15:42:23 -0700,
Josh Berkus <josh@agliodbs.com> wrote:
>
> Table "events", the largest table in the database, contains event schedule
> listing with 11 attributes and one dependant table as well as recursive
> relationships between events. Each event record can be (and Must be)
> related to either one Case or one Trial Group.
>
> Thus, I need to relate (in views and queries) each Event to the Union of Cases
> and Trial Groups. I just can't figure out how to do so without the database
> discarding the indexes on Cases in the process and things slowing to a crawl.
I think you might be able to do this using (one sided) outer joins of the event
table to the Case and Trial Group tables. The join rules will need to work for
exactly one of the two tables. You probably will want to use case statements in
the select list to pick values from the right table.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, josh@agliodbs.com
Subject: Re: Indexing UNIONs
In-Reply-To: <20020717120646.GA5520@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox