Bug 1402397 - [scale] - DWH use unamed and non-optimized query.
Summary: [scale] - DWH use unamed and non-optimized query.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine-dwh
Classification: oVirt
Component: Database
Version: 4.0.6
Hardware: x86_64
OS: Linux
unspecified
medium vote
Target Milestone: ovirt-4.0.7
: ---
Assignee: Shirly Radco
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-07 13:00 UTC by Eldad Marciano
Modified: 2016-12-12 12:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-12 12:10:12 UTC
oVirt Team: Metrics
sradco: ovirt-4.0.z?
sradco: planning_ack?
sradco: devel_ack?
sradco: testing_ack?


Attachments (Terms of Use)

Description Eldad Marciano 2016-12-07 13:00:02 UTC
Description of problem:
there is unnamed query which runs a lot and hit the performance.
this query found when running CFME with RHV.

LOG:  duration: 3059.466 ms  execute <unnamed>: SELECT
          history_id,
          history_datetime,
          current_user_id,
          current_user_name,
          cast(user_logged_in_to_guest as int),
          vm_id,
          seconds_in_status,
          cpu_usage_percent,
          memory_usage_percent,
          user_cpu_usage_percent,
          system_cpu_usage_percent,
          vm_ip,
          vm_client_ip,
          currently_running_on_host,
          vm_configuration_version,
          current_host_configuration_version
        FROM vm_samples_history
        WHERE vm_status = 1
        AND history_datetime >= '2016-12-04 22:00:00.000000+0000'
        AND history_datetime < '2016-12-04 23:00:00.000000+0000'
        ORDER BY history_datetime,
                 current_user_name,
                 vm_id



Version-Release number of selected component (if applicable):
4.0.6.1

How reproducible:
100%

Steps to Reproduce:
1. scale out lab with 27 hosts and 2.2K vms
2.
3.

Actual results:
non-optimized query 

Expected results:
optimized query.

Additional info:

Comment 1 Shirly Radco 2016-12-11 07:42:38 UTC
This query rum every hour. Unless for some reason there was an issue with aggregation and it is now running to catch up to the hour before last.

Comment 2 Eldad Marciano 2016-12-11 09:47:36 UTC
(In reply to Shirly Radco from comment #1)
> This query rum every hour. Unless for some reason there was an issue with
> aggregation and it is now running to catch up to the hour before last.

any chance it caused by https://bugzilla.redhat.com/show_bug.cgi?id=1402471 ?!

Comment 3 Yaniv Kaul 2016-12-12 12:10:12 UTC
For all we know, this is NOTABUG. Closing as such.
Eldad - please re-open properly, with all information.

Comment 4 Eldad Marciano 2016-12-12 12:30:47 UTC
(In reply to Yaniv Kaul from comment #3)
> For all we know, this is NOTABUG. Closing as such.
> Eldad - please re-open properly, with all information.

This bug caused by missing index's, somehow we can't find them on the relevant table "vm_samples_history" 

fixing it by re-running the crate_tables.sql script.

im not sure, but I suspect that something was failed on the upgrade process.
we'll update \ submit a new bug for it.


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