2020-05-16から1日間の記事一覧

インデックス追加時の影響

DB

MySQL (5.6) drop table tab1;create table tab1(col1 int,col2 timestamp(3));alter table tab1 add constraint tab1p primary key(col1); drop procedure proc1; delimiter //create procedure proc1()begin declare i int; set i = 1; while i <= 100000 …

パーティションプルーニング確認

DB

MySQL (5.6) drop table tab1; create table tab1( col1 int ,col2 int ,col3 int)partition by list(col2)( partition tab1p0 values in (0), partition tab1p1 values in (1)); alter table tab1 add constraint tab1p primary key(col1,col2); ※主キーに…

テーブル結合順の影響

DB

MySQL (8.0.18) ※HASH_JOIN, NO_HASH_JOINヒント句が8.0.18でしか動作しないため、8.0.18を使用 前提:テーブル1,2にインデックスなしテーブル1の件数=1000000テーブル2の件数=100テーブル1,2の結合後の件数=1000000 drop table tab1;drop table tab2; creat…