Bug 656469 - Perf: Add a timestamp index on the 1d table
Perf: Add a timestamp index on the 1d table
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Performance (Show other bugs)
4.0.0
Unspecified Unspecified
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Corey Welton
:
Depends On:
Blocks: jon30-bugs 656471
  Show dependency treegraph
 
Reported: 2010-11-23 14:56 EST by Heiko W. Rupp
Modified: 2011-05-23 21:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 656471 (view as bug list)
Environment:
Last Closed: 2011-05-23 21:09:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2010-11-23 14:56:57 EST
SELECT MAX(time_stamp) FROM RHQ_MEASUREMENT_DATA_NUM_1D

is very expensive with a huge number of data -- basically Oracle does a full index scan as the
existing index is (schedule_id, time_stamp).

Putting an index on time_stamp only would remove the FIS burden and speed up this operation.
This also follows the similar index on the 1h and 6h tables.
Comment 1 Heiko W. Rupp 2010-11-24 03:24:30 EST
Note, this can only be a shot term solution.

For a real fix, we need to "precompute" the data and store them in some separate table row.
See https://bugzilla.redhat.com/show_bug.cgi?id=621597
Comment 2 Lukas Krejci 2010-12-16 06:24:53 EST
commit 2ba9e1c4cfcb7046bfce34996d4955b0091c08a6
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Thu Dec 16 12:23:48 2010 +0100

    BZ 656469 - adding a temporary performance measure on the RHQ_MEASUREMENT_DATA_NUM_1D. Having an index on TIME_STAMP column helps the performance of the hourly jobs but a more involv
    
    This fix is part of RHQ 3.0.1 as well and therefore was added as schema spec 2.92.4 even though master is currently on schema spec 2.101.
    This is to support seamless upgrade of the releases, but of course intermittently this is schema spec is not going to get applied until a full dbsetup is executed.
Comment 3 Lukas Krejci 2010-12-20 05:07:21 EST
commit 4f29065c937833a03f96d5d09f2f36d9fd5781f9
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Mon Dec 20 10:58:40 2010 +0100

    BZ 656471 - adding missing index definition in db setup.
Comment 4 Lukas Krejci 2010-12-20 05:14:24 EST
The previous commit hash is incorrect.

The correct one is:
6d4c02a946fe0117ba033b385a747b0a9d1e133b
Comment 5 Corey Welton 2011-01-03 22:34:14 EST
QA closing - dev task, not much to readily QE here.
Comment 6 Corey Welton 2011-05-23 21:09:45 EDT
Bookkeeping - closing bug - fixed in recent release.

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