"Jim C. Nasby" <jnasby@xxxxxxxxxxxxx> writes: > That's because unfortunately PostgreSQL only keeps statistics on > individual columns. There's no stats kept on multi-column indexes; the > best the planner can do is use the stats for the first column. That's not what we do at all: we do look at the stats for each column and combine them. The deficiency is that we don't have any stats about cross-column correlations, and therefore must assume that the columns are independent (in the statistical sense). This is a poor assumption in the real world. But it's a lot subtler than "we only consider the first column". regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings