Deletion of availability data goes delete from rhq_availability where end_time < ? Without an index, the database is doing a full table scan which can be extremely expensive With the index, the database can use the index and can do an index range scan. rhq300=# explain delete from rhq_availability where end_time < 12345678 rhq300-# ; QUERY PLAN ---------------------------------------------------------------- Seq Scan on rhq_availability (cost=0.00..9.76 rows=1 width=6) Filter: (end_time < 12345678) (2 rows) rhq300=# create index end_time_index ON rhq_availability (end_time ); CREATE INDEX rhq300=# explain delete from rhq_availability where end_time < 12345678 ; QUERY PLAN --------------------------------------------------------------------------------------- Index Scan using end_time_index on rhq_availability (cost=0.00..8.27 rows=1 width=6) Index Cond: (end_time < 12345678) (2 rows)
Heiko, We would need more justification to add this index.
I recall that the initial idea came from observations in Oracle EM
not enough to go on here