In Feature Casualties of Large Databases you write:
A communication protocol that allows the query to signal out-of-band with a query’s results that it didn’t run particularly efficiently, say that it got results but wasn’t able to make use of an index. This would allow a test suite to fail early by signaling the problem to a developer instead of finding out about it in production.
But is this really necessary? I mean, if it is used only inside test suite, then you could instrument your tests so that for every query EXPLAIN is first called on it, asserting which indices it will use? Or you assert that only indices are used. So then your test assertions fail like any other assertions if it changes (like because query is changed in the future)?
So I think this is mostly a tooling issue where test frameworks does not expose such asserts readily available.
In Feature Casualties of Large Databases you write:
But is this really necessary? I mean, if it is used only inside test suite, then you could instrument your tests so that for every query
EXPLAINis first called on it, asserting which indices it will use? Or you assert that only indices are used. So then your test assertions fail like any other assertions if it changes (like because query is changed in the future)?So I think this is mostly a tooling issue where test frameworks does not expose such asserts readily available.