Skip to content

Conversation

@akagane99
Copy link
Contributor

@akagane99 akagane99 commented May 22, 2019

#137

バグ修正のプルリクエストです。
ご確認の上、マージお願いします。

動作確認

// 会員数: 16000程度
// プライベートルーム:一般=利用する
// pages: 16655件

修正前
(64 total, クエリの実行時間 6.0291 秒)

修正後
(64 total, クエリの実行時間 0.0128 秒)

修正前explain

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE nc2_pages ALL room_id,parent_id,space_type,space_type_2 NULL NULL NULL 16655 Using where; Using filesort
1 SIMPLE nc2_menu_detail ref PRIMARY PRIMARY 4 const 187 Using where
1 SIMPLE nc2_pages_users_link eq_ref PRIMARY,user_id PRIMARY 126 nc2.nc2_pages.room_id,const 1 Using where
1 SIMPLE nc2_authorities eq_ref PRIMARY PRIMARY 4 nc2.nc2_pages_users_link.role_authority_id 1 Using where

修正後explain

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE nc2_pages range room_id,parent_id,space_type,space_type_2 space_type 124 NULL 48 Using index condition; Using where; Using filesort
1 SIMPLE nc2_menu_detail ref PRIMARY PRIMARY 4 const 187 Using where
1 SIMPLE nc2_pages_users_link eq_ref PRIMARY,user_id PRIMARY 126 nc2.nc2_pages.room_id,const 1 Using where
1 SIMPLE nc2_authorities eq_ref PRIMARY PRIMARY 4 nc2.nc2_pages_users_link.role_authority_id 1 Using where

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants