Re: Many-To-Many Bridge Table Index - Mailing list pgsql-general

From Richard Huxton
Subject Re: Many-To-Many Bridge Table Index
Date
Msg-id 433CE384.7070709@archonet.com
Whole thread Raw
In response to Many-To-Many Bridge Table Index  (Sergei Dubov <sdubov@gmail.com>)
List 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

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: postmaster does not shut down
Next
From: Richard Huxton
Date:
Subject: Re: security documentation