"Fabio Panizzutti" <[EMAIL PROTECTED]> writes: > I don't understand why the planner chose a different query plan on > identical tables with same indexes .
Different data statistics; not to mention different table sizes (the cost equations are not linear). Have you ANALYZEd (or VACUUM ANALYZEd) both tables recently? If the stats are up to date but still not doing the right thing, you might try increasing the statistics target for the larger table's tag_id column. See ALTER TABLE SET STATISTICS. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match