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
Post a Comment