Closed tbdingqi closed 9 years ago
Can you clarify if this is an optimization or if this is a bugfix? If it is a bugfix, please include a test case that reproduces the bug that the patch fixes.
This looks like an optimization to me; if there are more fields in the template than in the index, sooner or later one won't be in the index, and we will fail on like 4739.
To, chipturner . Yes, it is an optimization. You are right,In this case it will fail in 4739. But some compare calculation is done before. if prebuilt->n_template > index->n_fields added, unnecessary calculation is saved.
As suggested by the references, this was included in WebScaleSQL as of a while ago, most recently in:
https://github.com/webscalesql/webscalesql-5.6/commit/eb5af62f14e3f485f18b7b95409cb7e7fe2bc7e8
Sorry,I forgot to actually close out this PR when that got pushed.
Thanks!
Before check column by column, we can check whether the column number required is more than that in the index, if yes, prefix_index_cluster_optimization can not be used for this row.