Re: [GENERAL] Many-To-Many Bridge Table Index

2005-09-30 Thread Peter Eisentraut
Am Donnerstag, 29. September 2005 21:44 schrieb Sergei Dubov: 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? It could use the index, but whether it will depends on the particular data distribution. The EXPLAIN command

Re: [GENERAL] Many-To-Many Bridge Table Index

2005-09-30 Thread Richard Huxton
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

[GENERAL] Many-To-Many Bridge Table Index

2005-09-30 Thread Sergei Dubov
Hi guys, I'd really appreciate if you could clarify this to me. Let's say I have a table named TABLE_A that is a bridge to many-to-many relationship between TABLE_B and TABLE_C, as such here is my declaration: CREATE TABLE table_a ( table_b_idINT4NOT NULL REFERENCES

Re: [GENERAL] Many-To-Many Bridge Table Index

2005-09-30 Thread Dawid Kuroczko
On 9/30/05, Sergei Dubov [EMAIL PROTECTED] wrote: Hi guys,I'd really appreciate if you could clarify this to me. Let's say I havea table named TABLE_A that is a bridge to many-to-many relationshipbetween TABLE_B and TABLE_C, as such here is my declaration: CREATE TABLE table_a (table_b_idINT4NOT

[GENERAL] Many-To-Many Bridge Table Index

2005-09-29 Thread Sergei Dubov
Hi guys, I'd really appreciate if you could clarify this to me. Let's say I have a table named TABLE_A that is a bridge to many-to-many relationship between TABLE_B and TABLE_C, as such here is my declaration: CREATE TABLE table_a ( table_b_id INT4NOT NULL