Indexing Question - Mailing list pgsql-general

From Mike
Subject Indexing Question
Date
Msg-id 1137100560.467461.151980@o13g2000cwo.googlegroups.com
Whole thread Raw
Responses Re: Indexing Question  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-general
Hi,

My table structure is the following:

tbl_A ----one-to-many---> tbl_B ----one-to-many---> tbl_C

Since it was important for me to trace back tbl_C records back to
tbl_A, I placed a tbl_A_id inside tbl_C.

Now, in order to optimize my database for speed, I want to index my
tbl_B for it's tbl_A_id. So far so good. Now, with tbl_C, it makes
sense that all records of tbl_A sit next to eachother so I could index
tbl_A_id (which are not used as often in my queries), or index by
tbl_B_id. Or both of them.

To be clear, my question is: Does it make sense for me to index a table
by field_1 with the intention of having postgreSQL place those records
next to each other for faster queries that wouldn't necessarily
reference field_1?

Thanks,
Mike


pgsql-general by date:

Previous
From: ptjm@interlog.com (Patrick TJ McPhee)
Date:
Subject: Re: Plans for 8.2?
Next
From: Baldur Norddahl
Date:
Subject: Re: Plans for 8.2?