Hierarchy indicies

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Hierarchy indicies
Дата
Msg-id 39099CAA.2EB27536@cupid.suninternet.com
обсуждение исходный текст
Список pgsql-general
I have a single base table from which I inherit various
other tables but, especially when doing joins, this is
not very efficient. For example whenever you do a query like:

select * from table* where fieldid = 2345;

the plan ends up doing scans across all the tables that
inherit "table". What I want is to be able to create an
index over the whole hierarchy, like:

create index table_index on table*(fieldname)

and then have the index used when appropriate. There are
some situations where I have to do a join between two
hierarchies. Currently it ends up with many, many
nested loops and sequential scans, whereas with an index
like above would reduce it to a single Hash Join (or
equivalent).

From looking at the source you can't have a single index
reference multiple tables...

Any ideas?
--
Martijn van Oosterhout <kleptog@cupid.suninternet.com>
http://cupid.suninternet.com/~kleptog/

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

Предыдущее
От: frank
Дата:
Сообщение: plperl.so ?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: referencial integrity constraint bug in version 7.0 beta 5