Hi @nurlan
I am sharing the details, which are that the query does not have any index on the column and is scanning the entire table.
Here the below select query is scanning the entire table, but we are not seeing that information in the logs as well.
CREATE TABLE tt_ent_log_tbl
(
tt_ent_log_asoctn_id
bigint(20) NOT NULL AUTO_INCREMENT COMMENT âSurrogate keyâ,
tt_ent_log_id
bigint(20) NOT NULL COMMENT âOT Event Log Idâ,
entity_type
varchar(20) DEFAULT NULL COMMENT âThe type of the entity for which the event occuredâ,
entity_id
bigint(20) DEFAULT NULL COMMENT âThe id of the object for which the event occuredâ,
status
char(1) NOT NULL DEFAULT âAâ COMMENT âValue is âAâ or âIâ, to indicate status is Active or Inactiveâ,
crt_user
varchar(255) NOT NULL COMMENT âCreation Userâ,
crt_dt
datetime NOT NULL DEFAULT current_timestamp() COMMENT âCreation Timestampâ,
last_upd_user
varchar(255) NOT NULL COMMENT âLast Update Userâ,
last_upd_dt
datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT âLast Update Timestampâ,
source_sys
varchar(255) DEFAULT NULL COMMENT âSource from which record came fromâ,
PRIMARY KEY (tt_ent_log_asoctn_id
),
KEY idx_tt_ent_log_assostn_02
(tt_ent_log_id
),
KEY idx_tt_ent_log_assostn_01
(entity_id
,entity_type
)
) ENGINE=InnoDB;
MariaDB [tds]> select * from tt_ent_log_tbl where status=âLâ;
Empty set (1 min 27.678 sec)
MariaDB [tds]> explain select * from tt_ent_log_tbl where status=âLâ;
±-----±------------±--------------------------±-----±--------------±-----±--------±-----±---------±------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
±-----±------------±--------------------------±-----±--------------±-----±--------±-----±---------±------------+
| 1 | SIMPLE | ot_event_log_associations | ALL | NULL | NULL | NULL | NULL | 30971587 | Using where |
±-----±------------±--------------------------±-----±--------------±-----±--------±-----±---------±------------+
1 row in set (0.000 sec)
MariaDB [tds]> select count(1) from tt_ent_log_tbl;
±---------+
| count(1) |
±---------+
| 37709813 |
±---------+
1 row in set (27.457 sec)
SET timestamp=1745419812;
set autocommit=1;
User@Host: ts_ap_usr[ts_ap_us] @ [10.6.12.142]
Thread_id: 1155096 Schema: tds QC_hit: No
Query_time: 0.000417 Lock_time: 0.000156 Rows_sent: 1 Rows_examined: 2
Rows_affected: 0 Bytes_sent: 1377
SET timestamp=1745419812;
select v1_0.addr_id,v1_0.addr_detail,v1_0.addr_line_1,v1_0.addr_line_2,v1_0.addr_line_3,v1_0.cas_loc_key,v1_0.city,v1_0.cntry_cd,v1_0.comm_id,v1_0.comm_type_c
d,v1_0.county,v1_0.crt_dt,v1_0.crt_user,v1_0.last_upd_dt,v1_0.last_upd_user,v1_0.postal_cd,v1_0.postal_cd2,v1_0.source_sys,v1_0.state_cd,v1_0.status from addr
esses v1_0 where v1_0.comm_id=26135451 and v1_0.status=âAâ order by v1_0.last_upd_dt desc;
Time: 250423 7:48:51
User@Host: tpd[temp_usr] @ localhost
Thread_id: 1158802 Schema: tds QC_hit: No
Query_time: 81.177402 Lock_time: 0.000183 Rows_sent: 0 Rows_examined: 37709366
Rows_affected: 0 Bytes_sent: 1046
SET timestamp=1745419731;
select * from tt_ent_log_tbl where status=âLâ;
Time: 250423 7:50:12
User@Host: vh_ap_ur[vh_ap_ur] @ [10.1.15.160]
Thread_id: 1159971 Schema: tds QC_hit: No
Query_time: 0.000603 Lock_time: 0.000395 Rows_sent: 8 Rows_examined: 8
Rows_affected: 0 Bytes_sent: 807
SET timestamp=1745419812;
DESCRIBE location_types
;
User@Host: ts_ap_ur[ts_ap_ur] @ [10.18.92.142]
Thread_id: 1155096 Schema: tds QC_hit: No
Query_time: 0.000276 Lock_time: 0.000114 Rows_sent: 1 Rows_examined: 2
Rows_affected: 0 Bytes_sent: 982
SET timestamp=1745419812;
select v1_0.vendor_pref_id,v1_0.crt_dt,v1_0.crt_user,v1_0.facility_id,v1_0.last_upd_dt,v1_0.last_upd_user,v1_0.pref_cat_cd,v1_0.pref_cd,v1_0.pref_id,v1_0.source_sys,v1_0.status,v1_0.vendor_id from vend_prnces v1_0 where v1_0.vendor_id=24093 and v1_0.pref_id!=0 and v1_0.pref_cat_cd=âPH_USGâ and v1_0.status=âAâ and v1_0.pref_cd=âPPHâ order by v1_0.last_upd_dt desc;
User@Host: tm_ap_usr[tm_ap_usr] @ [10.18.12.142]
Thread_id: 1155096 Schema: tds QC_hit: No
Query_time: 0.000286 Lock_time: 0.000119 Rows_sent: 1 Rows_examined: 2
Rows_affected: 0 Bytes_sent: 922
SET timestamp=1745419812;
select v1_0.phone_num_id,v1_0.cas_loc_key,v1_0.comm_id,v1_0.comm_type_cd,v1_0.crt_dt,v1_0.crt_user,v1_0.last_upd_dt,v1_0.last_upd_user,v1_0.phone_ext,v1_0.phone_num,v1_0.source_sys,v1_0.status from ph_ners v1_0 where v1_0.comm_id=26135457 and v1_0.status=âAâ order by v1_0.last_upd_dt desc;
User@Host: tm_ap_ur[tm_ap_ur] @ [10.14.12.142]
Thread_id: 1155096 Schema: tds QC_hit: No
: