Re: [GENERAL] Query planner and foreign key constraints

2009-01-12 Thread Christian Schröder
Christian Schröder wrote: When I join both tables using key1 and key2 there will be exactly 1630788 rows because for each row in table2 there *must* exist a row in table1. But the query planner doesn't think so: # explain analyze select * from table1 inner join table2 using (key1, key2);

Re: [GENERAL] Query planner and foreign key constraints

2009-01-04 Thread Christian Schröder
Christian Schröder wrote: in our PostgreSQL 8.2.9 database I have these tables: create table table1 ( key1 char(12), key2 integer, primary key (key1, key2) ); create table table2 ( key1 char(12), key2 integer, key3 varchar(20), primary k

Re: [GENERAL] Query planner and foreign key constraints

2008-12-30 Thread Christian Schröder
Filip Rembiałkowski wrote: create table table1 ( key1 char(12), key2 integer, primary key (key1, key2) ); create table table2 ( key1 char(12), key2 integer, key3 varchar(20), primary key (key1, key2, key3),

Re: [GENERAL] Query planner and foreign key constraints

2008-12-29 Thread Filip Rembiałkowski
2008/12/30 Christian Schröder > Hi list, > in our PostgreSQL 8.2.9 database I have these tables: > > create table table1 ( > key1 char(12), > key2 integer, > primary key (key1, key2) > ); > > create table table2 ( > key1 char(12), > key2 integer, > key3 v