cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 623 forks source link

Multi-column IndexScan plan selection fix #1305

Open vkonagar opened 6 years ago

vkonagar commented 6 years ago

This PR fixes the issue https://github.com/cmu-db/peloton/issues/1299. This changes the way we find index match for predicate columns in IndexScan rule implementation. Specifically, this change makes sure that the optimizer picks a multi-column index only if the predicate columns match the index columns in order.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.002%) to 77.267% when pulling 3a20b40b6c7a6924cccac43e151d46102b23b46b on vkonagar:master into 54b02a478629a591e1042f00d4feb6441ed30d92 on cmu-db:master.

apavlo commented 6 years ago

@vkonagar Can you provide test cases for this to know what you fixed? Thanks!

vkonagar commented 6 years ago

@apavlo Andy, I have added a test to verify the query plan correctness with respect to multi-column indexes.

This doesn't fix the cost model for multi-column indexes, which is not currently supported in the optimizer. I have talked to bowei and we will look into that.

chenboy commented 6 years ago

As discussed in today's meeting, we want to fix the cost model to consider multi-column indices. Let me see if I can fix it. @GustavoAngulo @nappelson I'm wondering if we have a testing infrastructure for cost model correctness right now?

apavlo commented 6 years ago

This is another important fix that we are going to need for TPC-C.