Hi!
I have two tables:
table1 (about 200000 records)
number varchar(8)
table2 (about 2000000 records)
number varchar(8)
Fields 'number' in both tables have standard indexes. For each record in table1 there is about 10 records in table2 assigned.
I execute query:
explain select table1.number from table1, table2 where table1.number = table2.number;
Query plan shows that indexes won't be used, Seq Scans all over ;)
But if I reduce amount of records in table1 to ~2000 query plan starts showing that index will be used.
Maybe somebody can tell me why postgresql behaves in that way?