Indexing Question

From: "Mike" <akiany(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Indexing Question
Date: 2006-01-12 21:16:00
Message-ID: 1137100560.467461.151980@o13g2000cwo.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Baldur Norddahl 2006-01-12 21:40:40 Re: Plans for 8.2?
Previous Message Doug McNaught 2006-01-12 21:07:19 Re: Plans for 8.2?