MySQL Forums
Forum List  »  Performance

Re: index not being pick up
Posted by: Raf Mahn
Date: January 17, 2018 12:26AM

Thanks for the tip. I tried adding the variables to a table and joining, see below, no luck :( .

If I remove the or condition "or flag.`override_enabled` = true" it will work, but I need the or condition.

create or replace algorithm=merge view `vw_property`
as select property.*
FROM `property` join flag on (`property`.`scope_id` = flag.`scope_id` or flag.`override_enabled` = true)
with check option;

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE flag ALL override_enabled_idx,scope_id_idx NULL NULL NULL 1 NULL
1 SIMPLE property ALL uq_reference_idx NULL NULL NULL 15 Using where; Using join buffer (Block Nested Loop)

create or replace algorithm=merge view `vw_property`
as select property.*
FROM `property` join flag where (`property`.`scope_id` = flag.`scope_id` or flag.`override_enabled` = true)
with check option;

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE flag ALL override_enabled_idx,scope_id_idx NULL NULL NULL 1 NULL
1 SIMPLE property ALL uq_reference_idx NULL NULL NULL 15 Using where; Using join buffer (Block Nested Loop)

Options: ReplyQuote


Subject
Views
Written By
Posted
2390
r r
January 15, 2018 11:57PM
1245
January 16, 2018 12:19AM
830
January 16, 2018 04:39PM
845
January 16, 2018 07:49PM
Re: index not being pick up
1027
January 17, 2018 12:26AM
1252
January 17, 2018 01:07AM
1031
January 17, 2018 01:19AM
886
January 17, 2018 12:41PM
1005
January 19, 2018 07:26AM
1077
January 21, 2018 04:31PM
821
January 21, 2018 05:41PM
854
January 22, 2018 03:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.