Inefficient db call while doing a image_get with image_id.

Bug #1434578 reported by Ajaya Agrawal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Kamil Rykowski

Bug Description

I am running MySql as backend and I can see two queries being done when I try to get an image.

In first query the tables images, image_locations and image_properties are joined and in another query tags related to that image are fetched from the db. These two can be combined to one query which will do a join of images, image_locations, image_properties and image_tags (join of these four tables happen when a call is made to get a list of all images).

Reference:
https://github.com/openstack/glance/blob/master/glance/db/__init__.py#L69-74

Ajaya Agrawal (ajayaa)
description: updated
Changed in glance:
assignee: nobody → Kamil Rykowski (kamil-rykowski)
Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/171674

Changed in glance:
importance: Undecided → Wishlist
Erno Kuvaja (jokke)
Changed in glance:
importance: Wishlist → Low
tags: added: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/171674
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=4734d8351389f61c575df812401eca561c2c0dbb
Submitter: Jenkins
Branch: master

commit 4734d8351389f61c575df812401eca561c2c0dbb
Author: Kamil Rykowski <email address hidden>
Date: Wed Apr 8 16:29:50 2015 +0200

    Reduce DB calls when getting an image

    Right now if you want to get a single image, two queries need to be
    executed:
    - Get image + associated locations and properties
    - Get associated tags for image

    Proposed solution combines these two queries into single one which gets
    image and all related data - locations, properties and tags. Similar
    pattern has been already implemented when querying for list of images.

    Change-Id: Ic4424bb1eb1769d8f621ebe111d95961ecf08479
    Closes-Bug: 1434578

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Erno Kuvaja (jokke) wrote :

Combining these queries introduced significant performance hit and thus was reverted in master. Change-Id: Ie58c6d272bf55c2ab2243d3fe6d8811ff3dc46ca

Should not be included to Kilo

Thierry Carrez (ttx)
no longer affects: glance/kilo
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (stable/kilo)

Change abandoned by Thierry Carrez (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/176956
Reason: Perf regression

Thierry Carrez (ttx)
Changed in glance:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: liberty-1 → 11.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.