mysql - Query on large i18n table slow in CakePHP -
the query below, using cakephp's i18n table, takes around 1000ms run. i18n table large - has around 600,000 rows. have default indexes on table, per cake schema.
how can speed queries up? caching them possible when cache needs cleared these queries run, , slow down performance quite noticeably.
select `category`.`id`, `category`.`slug`, `category`.`name`, `category`.`description`, `category`.`head_title`, `category`.`display_title`, `category`.`category_count`, `category`.`product_count`, `category`.`parent_id`, `category`.`lft`, `category`.`rght`, `category`.`sort_order`, `category`.`created`, `category`.`modified`, `category`.`image_processed`, ((rght - lft) = 1) `category__is_child`, (`i18n__name`.`content`) `category__i18n_name`, (`i18n__description`.`content`) `category__i18n_description`, (`i18n__slug`.`content`) `category__i18n_slug`, (`i18n__head_title`.`content`) `category__i18n_head_title`, (`i18n__meta_description`.`content`) `category__i18n_meta_description`, (`i18n__heading_title`.`content`) `category__i18n_heading_title` `fracmerl_dev`.`categories` `category` inner join `fracmerl_dev`.`i18n` `i18n__name` on (`category`.`id` = `i18n__name`.`foreign_key` , `i18n__name`.`model` = 'category' , `i18n__name`.`field` = 'name' , `i18n__name`.`locale` = 'eng') inner join `fracmerl_dev`.`i18n` `i18n__description` on (`category`.`id` = `i18n__description`.`foreign_key` , `i18n__description`.`model` = 'category' , `i18n__description`.`field` = 'description' , `i18n__description`.`locale` = 'eng') inner join `fracmerl_dev`.`i18n` `i18n__slug` on (`category`.`id` = `i18n__slug`.`foreign_key` , `i18n__slug`.`model` = 'category' , `i18n__slug`.`field` = 'slug' , `i18n__slug`.`locale` = 'eng') inner join `fracmerl_dev`.`i18n` `i18n__head_title` on (`category`.`id` = `i18n__head_title`.`foreign_key` , `i18n__head_title`.`model` = 'category' , `i18n__head_title`.`field` = 'head_title' , `i18n__head_title`.`locale` = 'eng') inner join `fracmerl_dev`.`i18n` `i18n__meta_description` on (`category`.`id` = `i18n__meta_description`.`foreign_key` , `i18n__meta_description`.`model` = 'category' , `i18n__meta_description`.`field` = 'meta_description' , `i18n__meta_description`.`locale` = 'eng') inner join `fracmerl_dev`.`i18n` `i18n__heading_title` on (`category`.`id` = `i18n__heading_title`.`foreign_key` , `i18n__heading_title`.`model` = 'category' , `i18n__heading_title`.`field` = 'heading_title' , `i18n__heading_title`.`locale` = 'eng') `i18n__slug`.`content` = 'category-slug' order `category`.`sort_order` asc, `category`.`name` asc limit 1
edit - indexes, result of show index i18n
i18n 0 primary 1 id 598455 null null btree i18n 1 locale 1 locale 5 null null btree i18n 1 model 1 model 3 null null btree i18n 1 row_id 1 foreign_key 18701 null null btree i18n 1 field 1 field 9 null null btree
if i18n table large try split , use multiple translation tables.
Comments
Post a Comment