Skip site navigation (1) Skip section navigation (2)

Re: Many-To-Many Bridge Table Index

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sergei Dubov <sdubov(at)gmail(dot)com>
Cc: PG-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Many-To-Many Bridge Table Index
Date: 2005-09-30 07:04:36
Message-ID: 433CE384.7070709@archonet.com (view raw or flat)
Thread:
Lists: pgsql-general
Sergei Dubov wrote:
> 
> This will automatically create a unique index on the primary key.
> 
> Well, if I do a query later like:
> 
> select * from table_a where table_b_id=1,
> 
> will the query use an index? Will this be true when I do join on this 
> table?

Yes to both (if the query plan thinks that is the most efficient way).

Of course a query on "table_c_id" can't use the index.
-- 
   Richard Huxton
   Archonet Ltd

In response to

pgsql-general by date

Next:From: Richard HuxtonDate: 2005-09-30 07:07:38
Subject: Re: security documentation
Previous:From: Oliver SiegmarDate: 2005-09-30 07:03:00
Subject: Improving GROUP BY?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group