Bug 1007564 - Database functions not fully optimized
Summary: Database functions not fully optimized
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.2.4
Assignee: Eli Mesika
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On: 905383
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-12 18:40 UTC by rhev-integ
Modified: 2016-02-10 19:01 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
This update takes advantage of PostgreSQL's ability to mark the volatility and strictness of a function, by setting all functions that only select data as stable, and by setting all functions that do not change the database as immutable.
Clone Of:
Environment:
Last Closed: 2013-10-25 18:43:54 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1468 0 normal SHIPPED_LIVE rhevm bug fix update 2013-10-25 22:42:24 UTC
oVirt gerrit 17962 0 None None None Never

Description rhev-integ 2013-09-12 18:40:38 UTC
+++ This bug is a RHEV-M zstream clone. The original bug is: +++
+++   https://bugzilla.redhat.com/show_bug.cgi?id=905383. +++

======================================================================



----------------------------------------------------------------------
Following comment by lvernia on January 29 at 09:57:33, 2013

Description of problem:

PostgreSQL enables marking the volatility and strictness of a function, which in turn might improve the running time of queries. We currently do not take advantage of this, and it might be worthwhile to mark functions this way.

Note on compatibility: while this is specific to PostgreSQL, it should be easy to write a script that drops all occurrences of IMMUTABLE, STABLE etc. if we ever move to another database implementation.


Additional info:

Volatility
----------
* A function should be marked as IMMUTABLE if it doesn't change the database, and if it doesn't perform any lookups (even for database configuration values) during its operation.
* A function should be marked STABLE if it doesn't change the database, but might perform lookups (IMMUTABLE is preferable if function meets the requirements).
* A function doesn't need to be marked VOLATILE, because that's the default.

STRICTNESS
----------
A function should be marked STRICT if it should return NULL when it is passed a NULL argument, and then the function won't even be called if it is indeed passed a NULL argument.

----------------------------------------------------------------------
Following comment by bazulay on June 30 at 14:36:38, 2013

The fix for that requires pre-integration as it touches many of our functions & stored-procedures.

----------------------------------------------------------------------
Following comment by amureini on August 21 at 12:42:06, 2013

Barak/Eli, is there any chance to get this for z-stream too (perhaps 3.2.4?).

There are several z-stream issues around DB performance, and this can be a considerable boost, especially considering the slow-changing nature of our system.

----------------------------------------------------------------------
Following comment by emesika on August 21 at 14:11:20, 2013

(In reply to Allon Mureinik from comment #2)
> Barak/Eli, is there any chance to get this for z-stream too (perhaps 3.2.4?).
> 
> There are several z-stream issues around DB performance, and this can be a
> considerable boost, especially considering the slow-changing nature of our
> system.

I think that it could be done

----------------------------------------------------------------------
Following comment by emesika on August 26 at 09:42:57, 2013

fixed in commit : df5cf3a

Comment 4 errata-xmlrpc 2013-10-25 18:43:54 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.

http://rhn.redhat.com/errata/RHBA-2013-1468.html


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