Tim Speetjens has posted comments on this change.

Change subject: userportal: optimize GetAllFromVms query
......................................................................


Patch Set 1:

The cost EXPLAIN reports for it drops from about 70000 to less than 1000. This 
of course depends on the number of records in the database: number of vms, 
number of users, pools.

Some counts from the db I tested with:

engine=> select count(*) from vm_static;
 count 
-------
  1207
(1 row)

engine=> select count(*) from users;
 count 
-------
  1250
(1 row)

engine=> select count(*) from user_vm_permissions_view;
 count 
-------
  1084
(1 row)


The EXISTS construct is particularly bad for larger datasets, because what's 
inside it, uses a variable from the vms table itself: ... AND entity_id = 
*vm_guid* ...

regards
Tim

-- 
To view, visit http://gerrit.ovirt.org/34006
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I541c9172c3ba9bcf989f9660baf06ec2e1fd02d7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tim Speetjens <tim.speetj...@gmail.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Tim Speetjens <tim.speetj...@gmail.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: No
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to