go-mysql-server icon indicating copy to clipboard operation
go-mysql-server copied to clipboard

indexed table access with IN predicate on primary key

Open max-hoffman opened this issue 3 years ago • 1 comments

re zach: "When we push down an IN clause to the table as an index, we should in principle remove that predicate from the filter. Not having the filter at all is even better than having it fast, and should work for IN expressions."

Filter(mytable.i IN (1, 2, 3, 4))
  └─ Projected table access on [i s]
         └─ IndexedTableAccess(mytable on [mytable.i])

We do not need to traverse every row in mytable, just point lookup the values in the filter.

max-hoffman avatar Nov 11 '21 15:11 max-hoffman