I have a table with more than 500k rows and I tried to use an index to get the results faster. I have an index of _Date and _Time with BTREE and its only works when I query only the columns _Date and _Time. How can I get the results fast but include all columns? I think that the columns type TEXT are a problem because they do not have a length.
SELECT _Date, _Time FROM logsTable WHERE TIMESTAMP(_Date, _Time) BETWEEN "2021-08-29T13:04" AND "2021-08-29T15:04" LIMIT 135, 15; #THIS IS THE INDEX THAT ONLY WORKS ONLY WITH _DATE AND _TIME ALTER TABLE logsTable ADD INDEX `logsTable_DateTime_Index` USING BTREE (`_Date`, `_Time`) VISIBLE; Table columns:
id int AI PK raw text type1 varchar(100) type2 varchar(100) desc text address1 varchar(100) address2 varchar(100) num varchar(100) _Date date _Time time serie varchar(100)