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

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -