Hierarchy indicies

From: Martijn van Oosterhout <kleptog(at)cupid(dot)suninternet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Hierarchy indicies
Date: 2000-04-28 14:14:02
Message-ID: 39099CAA.2EB27536@cupid.suninternet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)cupid(dot)suninternet(dot)com>
http://cupid.suninternet.com/~kleptog/

Browse pgsql-general by date

  From Date Subject
Next Message Julio Dominguez, BNC 2000-04-28 14:18:58 Data Warehousing and PostgreSQL
Previous Message Bill Barnes 2000-04-28 12:39:56 date format problem