indexes and inheritance

From: Edwin Grubbs <egrubbs(at)rackspace(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: indexes and inheritance
Date: 2001-06-20 20:21:05
Message-ID: Pine.LNX.4.30.0106201513310.19989-100000@zamboni.wc6.rackspace.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I have been unable to get indexes to be used when selecting from a parent
table. I have tried running VACUUM ANALYZE and looking through the
documentation, and the indexes are used fine if I select from a single
table.

Example:

create table parent (name text);
create table child (age int4) inherits (parent);
create index parent_index on parent (name);
create index child_index on child (name);

.. fill with data ..

This select will not use the index for the "name" column:

SELECT *
FROM parent*
WHERE name = 'bob';

But if I replace "parent*" with "parent" or "child", this query uses the
appropriate index.

-Edwin

Browse pgsql-general by date

  From Date Subject
Next Message Norman J. Clarke 2001-06-20 20:22:44 Re: Red Hat Database
Previous Message Dave Cramer 2001-06-20 20:19:54 Re: Red Hat DB announced - why not PostgreSQL?