Closed txxxxc closed 3 months ago
毎回全部レコード読み込んでいるのでまずいです
MariaDB [isucondition]> select * from isu_condition limit 1; +----+--------------------------------------+---------------------+------------+----------------------------------------------------+-----------------------------+----------------------------+ | id | jia_isu_uuid | timestamp | is_sitting | condition | message | created_at | +----+--------------------------------------+---------------------+------------+----------------------------------------------------+-----------------------------+----------------------------+ | 1 | eb104b95-3532-4828-8550-89da717b9667 | 2021-06-03 15:59:09 | 1 | is_dirty=false,is_overweight=false,is_broken=false | わ、わるくないね! | 2021-06-03 15:59:09.000000 | +----+--------------------------------------+---------------------+------------+----------------------------------------------------+-----------------------------+----------------------------+ 1 row in set (0.000 sec) MariaDB [isucondition]> explain SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = '8beaa485-8fbb-4f86-a1d0-2770a16000b2' ORDER BY `timestamp` DESC LIMIT 1\G; *************************** 1. row *************************** id: 1 select_type: SIMPLE table: isu_condition type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: 46693 Extra: Using where; Using filesort 1 row in set (0.000 sec)
close #3
毎回全部レコード読み込んでいるのでまずいです