mysql - Using an index with multiple OR statements -


I'm trying to get this query to use an index

  Select from SQL_NO_CACHE * products WHERE (stock_asabled = 1 or negative_stock_location = 1 or stock & gt; 0)   

This returns:

  id select_type Table type possible_ key key_len referee rows extra 1 simple p all multi-index faucet tap faucet 28 9 Where to use   

Multiple_ index is one in which stock_disabled, negative_s tock_allowed and stock in the same order i think that index does not work due to multiple or statements.

"Use index foo" P> Use products from pre> SELECT * INDEX (`multi_index`)

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -