Bug 613981 - Perf: consider putting an end_time index on rhq_availability
Summary: Perf: consider putting an end_time index on rhq_availability
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: RHQ Project
Classification: Other
Component: Database
Version: 4.0.0
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: rhq-perf
TreeView+ depends on / blocked
 
Reported: 2010-07-13 12:31 UTC by Heiko W. Rupp
Modified: 2018-10-27 16:17 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-02 19:16:55 UTC
Embargoed:


Attachments (Terms of Use)

Description Heiko W. Rupp 2010-07-13 12:31:26 UTC
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)

Comment 1 Ian Springer 2011-09-15 18:54:49 UTC
Heiko,

We would need more justification to add this index.

Comment 2 Heiko W. Rupp 2012-03-05 08:18:20 UTC
I recall that the initial idea came from observations in Oracle EM

Comment 3 Jay Shaughnessy 2014-06-02 19:16:55 UTC
not enough to go on here


Note You need to log in before you can comment on or make changes to this bug.