>>>>> "Zardosht" == Zardosht Kasheff <zardosht@stripped> writes:
Zardosht> I am interested to hear feedback on a patch I have submitted for a
Zardosht> feature request, bug #45759 (http://bugs.mysql.com/bug.php?id=45759).
Zardosht> This patch notifies the storage engine of when a full index scan is
Zardosht> about to take place (e.g. "select count(*) from foo use_index(a);").
Zardosht> By default (in handler.h), the storage engine does nothing. Individual
Zardosht> storage engines can choose to do whatever they want in this case to
Zardosht> make full index scans faster.
Zardosht> The purpose of this patch is to give storage engines an opportunity to
Zardosht> be aware of full index scans, and in turn, make optimizations should
Zardosht> they choose to.
I have applied the patch to MariaDB 5.1, with some minor modifications:
I noticed that the old code in MySQL didn't properly check the return
value from ha_index_init() and I have now fixed this in MariaDB.
PS: Your previous patch with MAX_KEY_PARTS didn't work right when it
comes to mysql_client_test. I have now fixed that too in MariaDB.
I also added a mysqltest to test that code.