List:Internals« Previous MessageNext Message »
From:Krunal Bauskar Date:June 5 2008 4:54pm
Subject:How to restrict use of indexes in MySQL query plan
View as plain text  
Hi,

I am looking for a way using which I can disable use of indexes in MySQL.

Under some specific condition even though MySQL optimizer think that index
is the best possible way to evalutate the query I want to turn it off so
that optimizer will not generate plan with index.
- I was looking into index_flags.
  - If I get it correctly MySQL use this to trace out SE indexing
    capabilities.
    Considering this I thought that if I just return 0 from this level
    MySQL optimizer will avoid using the index.
    Valid option start from 1 and so I select 0 (universal default)
	#define HA_READ_NEXT            1
    But unfortunately that is not the case. Even though I return 0
    MySQL is still using indexes.

Possible options:
=================

- Probably 0 is not the code to return.
  Something like 0xFF, 0xFE .... kind of code
- Or there is an alternative call to block this.

Any pointers on this front are really helpful.


-- 
Regards,
Krunal Bauskar
Thread
How to restrict use of indexes in MySQL query planKrunal Bauskar5 Jun
  • Re: How to restrict use of indexes in MySQL query planSergei Golubchik6 Jun
    • Re: How to restrict use of indexes in MySQL query planKrunal Bauskar10 Jun
      • Re: How to restrict use of indexes in MySQL query planSergei Golubchik10 Jun