From 3ed12d5a7473ee1711c471b74aaccfa9d544b33d Mon Sep 17 00:00:00 2001 From: "igor@rurik.mysql.com" <> Date: Thu, 19 Jun 2003 02:34:33 -0700 Subject: [PATCH] preload.result, preload.test: Removed non-generic info (key used blocks) preload.result, preload.test, lex.h, sql_yacc.yy: Syntax change for preload statement --- mysql-test/r/preload.result | 87 +++++++++---------------------------- mysql-test/t/preload.test | 41 +++++++++-------- sql/lex.h | 1 - sql/sql_yacc.yy | 10 ++--- 4 files changed, 44 insertions(+), 95 deletions(-) diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result index 0afd95b6fb8..4d9293c7929 100644 --- a/mysql-test/r/preload.result +++ b/mysql-test/r/preload.result @@ -46,169 +46,122 @@ count(*) 20672 flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 select count(*) from t1 where b = 'test1'; count(*) 4181 -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 217 Key_reads 45 -Key_write_requests 0 -Key_writes 0 select count(*) from t1 where b = 'test1'; count(*) 4181 -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 434 Key_reads 45 -Key_write_requests 0 -Key_writes 0 flush tables; flush status; select @@preload_buffer_size; @@preload_buffer_size 32768 -preload t1 keys; +load index into cache t1 keys; Table Op Msg_type Msg_text test.t1 preload_keys status OK -show status like "preload_%"; +show status like "key_read%"; Variable_name Value -show status like "key_%"; -Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 select count(*) from t1 where b = 'test1'; count(*) 4181 -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 217 Key_reads 45 -Key_write_requests 0 -Key_writes 0 flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 set session preload_buffer_size=256*1024; select @@preload_buffer_size; @@preload_buffer_size 262144 -preload t1 keys ignore leaves; +load index into cache t1 keys ignore leaves; Table Op Msg_type Msg_text test.t1 preload_keys status OK -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 select count(*) from t1 where b = 'test1'; count(*) 4181 -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 217 Key_reads 45 -Key_write_requests 0 -Key_writes 0 flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 set session preload_buffer_size=1*1024; select @@preload_buffer_size; @@preload_buffer_size 1024 -preload t1 keys, t2 keys (primary,b) ignore leaves; +load index into cache t1 keys, t2 keys (primary,b) ignore leaves; Table Op Msg_type Msg_text test.t1 preload_keys status OK test.t2 preload_keys status OK -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 select count(*) from t1 where b = 'test1'; count(*) 4181 select count(*) from t2 where b = 'test1'; count(*) 2584 -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 351 Key_reads 73 -Key_write_requests 0 -Key_writes 0 flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 -preload t3 keys, t2 keys (primary,b) ; +load index into cache t3 keys, t2 keys (primary,b) ; Table Op Msg_type Msg_text test.t3 preload_keys error Table 'test.t3' doesn't exist test.t2 preload_keys status OK -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 -preload t3 keys (b), t2 keys (c) ; +load index into cache t3 keys (b), t2 keys (c) ; Table Op Msg_type Msg_text test.t3 preload_keys error Table 'test.t3' doesn't exist test.t2 preload_keys error Key column 'c' doesn't exist in table test.t2 preload_keys status Operation failed -show status like "key_%"; +show status like "key_read%"; Variable_name Value -Key_blocks_used 918 Key_read_requests 0 Key_reads 0 -Key_write_requests 0 -Key_writes 0 drop table t1, t2; diff --git a/mysql-test/t/preload.test b/mysql-test/t/preload.test index 1fd0d0a5b17..7357b42c599 100755 --- a/mysql-test/t/preload.test +++ b/mysql-test/t/preload.test @@ -54,48 +54,47 @@ select count(*) from t1; select count(*) from t2; flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; select count(*) from t1 where b = 'test1'; -show status like "key_%"; +show status like "key_read%"; select count(*) from t1 where b = 'test1'; -show status like "key_%"; +show status like "key_read%"; flush tables; flush status; select @@preload_buffer_size; -preload t1 keys; -show status like "preload_%"; -show status like "key_%"; +load index into cache t1 keys; +show status like "key_read%"; select count(*) from t1 where b = 'test1'; -show status like "key_%"; +show status like "key_read%"; flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; set session preload_buffer_size=256*1024; select @@preload_buffer_size; -preload t1 keys ignore leaves; -show status like "key_%"; +load index into cache t1 keys ignore leaves; +show status like "key_read%"; select count(*) from t1 where b = 'test1'; -show status like "key_%"; +show status like "key_read%"; flush tables; flush status; -show status like "key_%"; +show status like "key_read%"; set session preload_buffer_size=1*1024; select @@preload_buffer_size; -preload t1 keys, t2 keys (primary,b) ignore leaves; -show status like "key_%"; +load index into cache t1 keys, t2 keys (primary,b) ignore leaves; +show status like "key_read%"; select count(*) from t1 where b = 'test1'; select count(*) from t2 where b = 'test1'; -show status like "key_%"; +show status like "key_read%"; flush tables; flush status; -show status like "key_%"; -preload t3 keys, t2 keys (primary,b) ; -show status like "key_%"; +show status like "key_read%"; +load index into cache t3 keys, t2 keys (primary,b) ; +show status like "key_read%"; flush tables; flush status; -show status like "key_%"; -preload t3 keys (b), t2 keys (c) ; -show status like "key_%"; +show status like "key_read%"; +load index into cache t3 keys (b), t2 keys (c) ; +show status like "key_read%"; drop table t1, t2; diff --git a/sql/lex.h b/sql/lex.h index 0c3e58c4a50..f7c4418cb8d 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -300,7 +300,6 @@ static SYMBOL symbols[] = { { "POLYGON", SYM(POLYGON),0,0}, { "PURGE", SYM(PURGE),0,0}, { "PRECISION", SYM(PRECISION),0,0}, - { "PRELOAD", SYM(PRELOAD),0,0}, { "PREV", SYM(PREV_SYM),0,0}, { "PRIMARY", SYM(PRIMARY_SYM),0,0}, { "PROCEDURE", SYM(PROCEDURE),0,0}, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 0b18b7ffdc5..323fa3da6b6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -310,7 +310,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token DUMPFILE %token PACK_KEYS_SYM %token PARTIAL -%token PRELOAD %token PRIMARY_SYM %token PRIVILEGES %token PROCESS @@ -581,7 +580,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); type int_type real_type order_dir opt_field_spec lock_option udf_type if_exists opt_local opt_table_options table_options table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type opt_var_ident_type - delete_option opt_temporary all_or_any opt_distinct opt_ignore_leafs + delete_option opt_temporary all_or_any opt_distinct opt_ignore_leaves %type ULONG_NUM raid_types merge_insert_types @@ -1838,7 +1837,7 @@ table_to_table: }; preload: - PRELOAD + LOAD INDEX INTO CACHE_SYM { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -1852,7 +1851,7 @@ preload_list: | preload_list ',' preload_keys; preload_keys: - table_ident preload_keys_spec opt_ignore_leafs + table_ident preload_keys_spec opt_ignore_leaves { LEX *lex=Lex; SELECT_LEX *sel= &lex->select_lex; @@ -1880,7 +1879,7 @@ preload_key_list_or_empty: | '(' key_usage_list2 ')' {} ; -opt_ignore_leafs: +opt_ignore_leaves: /* empty */ { $$= 0; } | IGNORE_SYM LEAVES { $$= TL_OPTION_IGNORE_LEAVES; } @@ -4374,7 +4373,6 @@ keyword: | PASSWORD {} | POINT_SYM {} | POLYGON {} - | PRELOAD {} | PREV_SYM {} | PROCESS {} | PROCESSLIST_SYM {}