mysql:5564
From: <office@xxxxxxxxxx>
Date: Mon, 27 May 2002 23:17:22 +0900
Subject: [mysql 05564] Re: OPTIMIZE で最適化できません。
たけです。 レス遅くなりました。 On Fri, 24 May 2002 11:21:39 +0900 SUGAWARA Hajime <sugawara@xxxxxxxxxx> wrote: > 菅原です。 > > 少なくともこちらではoptimize tableしても同じ値を返しますけど……。 実行したSQLは下記の通りです。 サーバのバージョンはMySQL 3.23.43です。 mysql> show index from kansou_tb; +-----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Comment | +-----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+ | kansou_tb | 0 | PRIMARY | 1 | k_id | A | 847150 | NULL | NULL | | | kansou_tb | 1 | stno | 1 | stno | A | 2150 | NULL | NULL | | | kansou_tb | 1 | u_id | 1 | u_id | A | 56476 | NULL | NULL | | | kansou_tb | 1 | tokuten | 1 | tokuten | A | 13 | NULL | NULL | | | kansou_tb | 1 | mcode | 1 | mcode | A | 1 | NULL | NULL | | | kansou_tb | 1 | dkey | 1 | dkey | A | 18024 | NULL | NULL | | | kansou_tb | 1 | k_flag | 1 | k_flag | A | 3 | NULL | NULL | | +-----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+ 7 rows in set (0.00 sec) mysql> optimize table kansou_tb; +-----------------+----------+----------+----------+ | Table | Op | Msg_type | Msg_text | +-----------------+----------+----------+----------+ | t_MA2.kansou_tb | optimize | status | OK | +-----------------+----------+----------+----------+ 1 row in set (2.01 sec) mysql> show index from kansou_tb; +-----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Comment | +-----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+ | kansou_tb | 0 | PRIMARY | 1 | k_id | A | NULL | NULL | NULL | | | kansou_tb | 1 | stno | 1 | stno | A | NULL | NULL | NULL | | | kansou_tb | 1 | u_id | 1 | u_id | A | NULL | NULL | NULL | | | kansou_tb | 1 | tokuten | 1 | tokuten | A | NULL | NULL | NULL | | | kansou_tb | 1 | mcode | 1 | mcode | A | NULL | NULL | NULL | | | kansou_tb | 1 | dkey | 1 | dkey | A | NULL | NULL | NULL | | | kansou_tb | 1 | k_flag | 1 | k_flag | A | NULL | NULL | NULL | | +-----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+ 7 rows in set (0.00 sec) やっぱり、カーディナリティがNULLになり、インディックスの効果 がなくなります。なんででしょうね? -- j-ken/take <take@xxxxxxxxxx>
5533 2002-05-22 22:14 [<office@xxxxxxxxxx> ] OPTIMIZE で最適化できません。 5540 2002-05-23 23:01 ┗[<moeru@xxxxxxxxxx> ] 5542 2002-05-24 02:20 ┗[<office@xxxxxxxxxx> ] 5543 2002-05-24 11:21 ┗[SUGAWARA Hajime <sug] -> 5564 2002-05-27 23:17 ┗[<office@xxxxxxxxxx> ] 5568 2002-05-28 12:24 ┗[SUGAWARA Hajime <sug]