EXPLAIN SELECT * FROM sensor_events WHERE recorded_at > '2024-11-01';CREATE TABLE sensor_events_p (...) PARTITION BY RANGE (YEAR(recorded_at)*100+MONTH(recorded_at)) (PARTITION p202201 VALUES LESS THAN (202202), ...);ALTER TABLE sensor_events PARTITION BY RANGE (...)SELECT PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS WHERE TABLE_NAME='sensor_events';ALTER TABLE sensor_events REORGANIZE PARTITION p_future INTO (...)ALTER TABLE sensor_events TRUNCATE PARTITION p202201;ALTER TABLE sensor_events DROP PARTITION p202201;TelemetriX IoT Cloud stores 3 years of sensor readings in a single sensor_events table โ now 900M rows. Queries for the current month scan the whole table. Range partitioning by month will limit scans to the relevant partition. You must also archive partitions older than 18 months to a cold storage table.
No step-by-step guidance. Use the Reference window for command syntax only. You must determine the approach, the correct columns and order, and verify your own results.