Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql indexes #84

Closed
nadar opened this issue Jun 5, 2018 · 0 comments
Closed

sql indexes #84

nadar opened this issue Jun 5, 2018 · 0 comments
Assignees
Milestone

Comments

@nadar
Copy link
Member

nadar commented Jun 5, 2018

Add indexes

1.) Find placeholders in cms page for blocks:

SELECT `t1`.*, `t2`.`class` FROM `cms_nav_item_page_block_item` `t1` INNER JOIN `cms_block` `t2` ON t2.id=t1.block_id WHERE (`nav_item_page_id`=1) AND (`placeholder_var`='content') AND (`prev_id`=0) AND (`is_hidden`=0) ORDER BY `sort_index`
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using filesort
1 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 luya_env_dev.t1.block_id 1 100.00 NULL

2.) Get nav data in menu for langauge

SELECT `item`.`id`, `item`.`nav_id`, `item`.`title`, `item`.`description`, `item`.`keywords`, `item`.`alias`, `item`.`title_tag`, `item`.`timestamp_create`, `item`.`timestamp_update`, `item`.`create_user_id`, `item`.`update_user_id`, `nav`.`is_home`, `nav`.`parent_nav_id`, `nav`.`sort_index`, `nav`.`is_hidden`, `item`.`nav_item_type`, `item`.`nav_item_type_id`, `nav_container`.`alias` AS `container` FROM `cms_nav_item` `item` LEFT JOIN `cms_nav` `nav` ON nav.id=item.nav_id LEFT JOIN `cms_nav_container` `nav_container` ON nav_container.id=nav.nav_container_id WHERE ((`nav`.`is_deleted`=FALSE) AND (`item`.`lang_id`='2') AND (`nav`.`is_offline`=FALSE) AND (`nav`.`is_draft`=FALSE)) AND ((`publish_from` IS NULL) OR (`publish_from` <= 1528188945)) AND ((`publish_till` IS NULL) OR (`publish_till` >= 1528188945)) ORDER BY `container`, `parent_nav_id`, `nav`.`sort_index`
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE nav NULL ALL PRIMARY NULL NULL NULL 170 0.59 Using where; Using temporary; Using filesort
1 SIMPLE nav_container NULL eq_ref PRIMARY PRIMARY 4 schaulager.org2017.nav.nav_container_id 1 100.00 NULL
1 SIMPLE item NULL ALL NULL NULL NULL NULL 315 1.00 Using where; Using join buffer (Block Nested Loop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant