Question about indexes on tables with inherited children - Mailing list pgsql-general

From Bryan Montgomery
Subject Question about indexes on tables with inherited children
Date
Msg-id AANLkTim7BO6ym0Qnac49TlZUQA34tz_OuVhDRBs0r8UT@mail.gmail.com
Whole thread Raw
Responses Re: Question about indexes on tables with inherited children  (Sergey Konoplev <gray.ru@gmail.com>)
List pgsql-general
Hello,
A quick question (I think).
If I have Table_A with id integer, val text - and no data.
Table_B inherits from Table_A and has a bunch of data.
Table_C inherits from Table_A and has some data.
Table_X has id integer, someValue integer

If I do select * from Table_A a, Table_X x where a.id = x.id
and it only returns 1 or a few rows, should it use an index if I have an index built on Table_A using id?
Or do I need an index individually on B & C?
I thought having the index on A would be used, but in an analyze it was scanning the table until I created indexes on B & C.

If it should have worked, the only thing that I can think of was that the stats on the tables were maybe out of date? This is on 8.4.3.

Thanks,
Bryan.

pgsql-general by date:

Previous
From: Bryan Montgomery
Date:
Subject: Re: GSS Authentication
Next
From: Merlin Moncure
Date:
Subject: Re: postgres crash SOS