Re: Indexing UNIONs

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Indexing UNIONs
Дата
Msg-id 20020717120646.GA5520@wolff.to
обсуждение исходный текст
Ответ на Re: Indexing UNIONs  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: Indexing UNIONs
Список pgsql-sql
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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Alain Lavigne"
Дата:
Сообщение: Re: Need help on a troublesome query plan
Следующее
От: Masaru Sugawara
Дата:
Сообщение: Re: [HACKERS] please help on query