delete from bmx.tsld_rrddata_tos_0 where f_timestamp > 1600226278 ;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
Delete on tsld_rrddata_tos_0 (cost=0.57..70254.28 rows=1190726 width=6)
-> Index Scan using tsld_rrddata_tos_0_f_timestamp on tsld_rrddata_tos_0 (cost=0.57..70254.28 rows=1190726 width=6)
Index Cond: (f_timestamp > 1600226278)
(3 rows)
sla=# explain delete from bmx.tsld_rrddata_tos_0 where f_timestamp < 1600226278 ;
QUERY PLAN
---------------------------------------------------------------------------------------
Delete on tsld_rrddata_tos_0 (cost=0.00..16081852.60 rows=372578842 width=6)
-> Seq Scan on tsld_rrddata_tos_0 (cost=0.00..16081852.60 rows=372578842 width=6)
Filter: (f_timestamp < 1600226278)
(3 rows)
Условия же разные, вот и в одном случае имеет смысл использовать индекс, в другом нет
Обсуждают сегодня