[Rt-commit] rt branch, 4.4/oracle-exact-query-hint, created. rt-4.4.4-420-g9db58f1219
Jim Brandt
jbrandt at bestpractical.com
Thu May 6 17:07:55 EDT 2021
The branch, 4.4/oracle-exact-query-hint has been created
at 9db58f1219e5bfc278d0ddadcf6a8936245b3bf7 (commit)
- Log -----------------------------------------------------------------
commit 9db58f1219e5bfc278d0ddadcf6a8936245b3bf7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Thu May 6 17:04:59 2021 -0400
Add hint to use exact cursor sharing for FromSQL queries on Oracle
Oracle can run with CURSOR_SHARING set to multiple values
including force and exact. RT can run better when running
with force, but this can cause issues with poor performance
on certain ad hoc queries like those generated by the
query builder.
Add a hint for these queries to use exact.
diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
index 275ea76b66..ad1ac6e754 100644
--- a/share/html/Elements/CollectionList
+++ b/share/html/Elements/CollectionList
@@ -49,6 +49,7 @@
if (!$Collection && $Class eq 'RT::Tickets') {
$Collection = RT::Tickets->new( $session{'CurrentUser'} );
$Collection->FromSQL($Query);
+ $Collection->QueryHint("+CURSOR_SHARING_EXACT") if RT->Config->Get('DatabaseType') eq 'Oracle';
}
# flip HasResults from undef to 0 to indicate there was a search, so
diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index 1d3c815130..efaa285f7c 100644
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -153,6 +153,7 @@ $session{'CurrentSearchHash'} = {
my ($title, $ticketcount) = (loc("Find tickets"), 0);
if ( $session{'tickets'}->Query()) {
+ $session{'tickets'}->QueryHint("+CURSOR_SHARING_EXACT") if RT->Config->Get('DatabaseType') eq 'Oracle';
$ticketcount = $session{tickets}->CountAll();
$title = loc('Found [quant,_1,ticket,tickets]', $ticketcount);
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list