Bug 1347996 - Add index for better performance to vm disks usage tables
Summary: Add index for better performance to vm disks usage tables
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-dwh
Version: 3.6.8
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-3.6.8
: 3.6.8
Assignee: Shirly Radco
QA Contact: Eldad Marciano
URL:
Whiteboard:
Depends On:
Blocks: 1350313
TreeView+ depends on / blocked
 
Reported: 2016-06-19 19:59 UTC by Shirly Radco
Modified: 2016-07-27 14:11 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
With this update, an index to vm disks usage tables was added to improve query performance. Querying the tables and related views are now faster.
Clone Of:
: 1350313 (view as bug list)
Environment:
Last Closed: 2016-07-27 14:11:01 UTC
oVirt Team: Metrics
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ran these queries to validate performance with new index (1.35 KB, text/plain)
2016-07-19 10:28 UTC, eberman
no flags Details
ran these queries to validate performance with new index (1.03 KB, text/plain)
2016-07-19 10:28 UTC, eberman
no flags Details
ran these queries to validate performance with new index (1.12 KB, text/plain)
2016-07-19 10:29 UTC, eberman
no flags Details
ran these queries to validate performance with new index (1.35 KB, text/plain)
2016-07-19 10:29 UTC, eberman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1516 0 normal SHIPPED_LIVE rhevm-dwh 3.6.8 bug fix update 2016-07-27 18:08:03 UTC
oVirt gerrit 59449 0 master MERGED history: added index to vm disks usage tables 2016-06-21 07:10:48 UTC
oVirt gerrit 59909 0 ovirt-engine-dwh-3.6 MERGED history: added index to vm disks usage tables 2016-07-05 11:57:16 UTC

Description Shirly Radco 2016-06-19 19:59:54 UTC
Description of problem:
Add index for better performance to vm disks usage tables

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

How reproducible:


Steps to Reproduce:
1.Test query results against the tables in scale env before and after the change.

Comment 1 Oved Ourfali 2016-06-22 06:44:48 UTC
Shirly - this isn't posted/merged in 4.0, so can't move to modified.
Alexander's patch is already merged on 4.0. Can you make sure to backport this ASAP?

Comment 5 Shirly Radco 2016-07-12 06:51:04 UTC
This was in 3.6.8 build but I can't manage to add the target release for it.

Comment 6 Sandro Bonazzola 2016-07-12 13:18:01 UTC
Shirly, where's the 4.0 bug?

Comment 7 Shirly Radco 2016-07-12 14:27:59 UTC
(In reply to Sandro Bonazzola from comment #6)
> Shirly, where's the 4.0 bug?

ydary said we don't need another bug for it.
Yaniv, am I right?

Comment 9 Julie 2016-07-13 07:44:17 UTC
Thanks!

Comment 10 eberman 2016-07-19 10:28:09 UTC
Created attachment 1181571 [details]
ran these queries to validate performance with new index

Comment 11 eberman 2016-07-19 10:28:45 UTC
Created attachment 1181572 [details]
ran these queries to validate performance with new index

Comment 12 eberman 2016-07-19 10:29:10 UTC
Created attachment 1181573 [details]
ran these queries to validate performance with new index

Comment 13 eberman 2016-07-19 10:29:30 UTC
Created attachment 1181574 [details]
ran these queries to validate performance with new index

Comment 14 eberman 2016-07-19 10:37:36 UTC
Ran attached (cpu,samples.available_disk_size_gb +samples.used_disk_size_gb ,etc,,,) quires to validate performance time with new added index on system topology with simulated 500 hosts, 9.9K vms, ~30K disks.


[root@bkr-hv05 ~]# time psql -U ovirt_engine_history -f dash.sql
 cpu_total_vms | cpu_used_vms | mem_total_vms | mem_used_vms 
---------------+--------------+---------------+--------------
          9977 |         8073 |       1287808 |      1044096
(1 row)


real	0m0.315s
user	0m0.000s
sys	0m0.002s
[root@bkr-hv05 ~]# time psql -U ovirt_engine_history -f dashstg.sql
 total_vms | used_vms 
-----------+----------
    257872 |        5
(1 row)


real	0m0.452s
user	0m0.001s
sys	0m0.007s
[root@bkr-hv05 ~]# time psql -U ovirt_engine_history -f dashstgtotal.sql
 total 
-------
   441
(1 row)


real	0m0.007s
user	0m0.001s
sys	0m0.001s
[root@bkr-hv05 ~]# time psql -U ovirt_engine_history -f dashsthourly.sql
      the_date       | used 
---------------------+------
 2016-07-18 06:00:00 |     
 2016-07-18 07:00:00 |     
 2016-07-18 08:00:00 |     
 2016-07-18 09:00:00 |     
 2016-07-18 10:00:00 |  342
 2016-07-18 11:00:00 |  342
 2016-07-18 12:00:00 |  342
 2016-07-18 13:00:00 |  342
 2016-07-18 14:00:00 |  342
 2016-07-18 15:00:00 |  342
 2016-07-18 16:00:00 |  342
 2016-07-18 17:00:00 |  342
 2016-07-18 18:00:00 |  342
 2016-07-18 19:00:00 |  342
 2016-07-18 20:00:00 |  342
 2016-07-18 21:00:00 |  342
 2016-07-18 22:00:00 |  342
 2016-07-18 23:00:00 |  342
 2016-07-19 00:00:00 |  342
 2016-07-19 01:00:00 |  342
 2016-07-19 02:00:00 |  342
 2016-07-19 03:00:00 |  342
 2016-07-19 04:00:00 |  342
 2016-07-19 05:00:00 |  342
 2016-07-19 06:00:00 |     
(25 rows)


real	0m0.008s
user	0m0.001s
sys	0m0.002 

closing

Comment 16 errata-xmlrpc 2016-07-27 14:11:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-1516.html


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