The CVM Algorithm

from blog NULL BITMAP by Justin Jaffray, | ↗ original
Everything you need to know about query planning can be understood from this query: SELECT * FROM xy WHERE y = 3 ORDER BY x Imagine we have two indexes, one ordered on y, and one ordered on x. Then two possible plans suggest themselves: Plan 1: scan the y index, restricting it to the values of y such that y = 3, then sort the result by x. Plan 2:...