[Rt-commit] rt branch, 5.0/expensive-owner-inline-edit, created. rt-5.0.0beta1-45-g2e63c38d85

Aaron Trevena ast at bestpractical.com
Fri Jun 26 06:26:08 EDT 2020


The branch, 5.0/expensive-owner-inline-edit has been created
        at  2e63c38d852e5205f23e32f609c9f92d8f01aec9 (commit)

- Log -----------------------------------------------------------------
commit 265b1457020c23a9357b981487fee698922be2a0
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Fri Jun 26 10:03:54 2020 +0100

    Add section to upgrade docs about inline edit feature
    
    Add section in docs/UPGRADING-5.0 about inline-edit feature in ticket
    search results and possible impacts for owner field, using AutocompleteOwners
    configuration option.

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index e82a5670d0..113836022e 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -148,6 +148,27 @@ RT should also still run with GnuPG 1.4.x. It is not supported for GnuPG version
 2.0 or 2.1. On some Linux systems, you may need to add a new repo to get an
 updated GnuPG package with some version of 2.2.
 
+=item *
+
+RT search results and reports now allow inline editing of tickets, this greatly
+improves usability and convenience.
+
+Editable fields that require an ACL search per ticket, particularly Owner may
+result in slower page load times. You can make the owner field autocomplete
+to avoid the extra queries using the AutocompleteOwner configuration field
+L<https://docs.bestpractical.com/rt/4.4.4/RT_Config.html#AutocompleteOwners>.
+
+It may be possible to improve query times for owner and other ACL checking
+inline edit queries by adding an index to the ACL table, but the cost and
+benefit of any new index will vary according to the dataset and database.
+Adding the following indexes has been reported to help performance on some
+datasets with Postgres 9 : 
+
+ CREATE INDEX ACL2 ON acl (objecttype, objectid);
+
+ CREATE INDEX ACL3 ON acl (principalid, rightname, principaltype);
+
+
 =back
 
 =cut

commit aa6098ab2e81b6831a4022758c2a417c176280cf
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Fri Jun 26 10:36:40 2020 +0100

    Document possible ACL indexes to Postgres schema
    
    Document possible additional indexes for ACL table in Postgres schema and
    upgrade SQL to help with Owner inline-edit queries in ticket search

diff --git a/etc/schema.Pg b/etc/schema.Pg
index 5f6c3d85fb..c83de4fa5c 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -280,8 +280,13 @@ CREATE TABLE ACL (
 
 CREATE INDEX  ACL1 on ACL(RightName, ObjectType, ObjectId,PrincipalType,PrincipalId);
 
-
-
+---
+--- Indexes that could help performance for owner lookups in inline-edit fields
+--- reported to improve performance with Postgres 9.4
+---
+--- CREATE INDEX ACL2 ON acl (objecttype, objectid);
+--- CREATE INDEX ACL3 ON acl (principalid, rightname, principaltype);
+---
 
 
 
diff --git a/etc/upgrade/4.5.7/schema.Pg b/etc/upgrade/4.5.7/schema.Pg
index 29a5372a89..7e547557c9 100644
--- a/etc/upgrade/4.5.7/schema.Pg
+++ b/etc/upgrade/4.5.7/schema.Pg
@@ -13,3 +13,12 @@ CREATE TABLE AuthTokens (
 );
 
 CREATE INDEX AuthTokensOwner ON AuthTokens (Owner);
+
+---
+--- Indexes that could help performance for owner lookups in inline-edit fields
+--- reported to improve performance with Postgres 9.4
+---
+--- CREATE INDEX ACL2 ON acl (objecttype, objectid);
+--- CREATE INDEX ACL3 ON acl (principalid, rightname, principaltype);
+---
+

commit 2e63c38d852e5205f23e32f609c9f92d8f01aec9
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Fri Jun 26 11:23:25 2020 +0100

    Add OwnerReadonly to Ticket search column map
    
    Add OwnerReadonly field to column map for ticket search to allow use
    of the column without querying database per ticket for allowed owners
    or requiring the AutocompleteOwners field in configuration.

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index 113836022e..cf375ffbee 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -156,7 +156,8 @@ improves usability and convenience.
 Editable fields that require an ACL search per ticket, particularly Owner may
 result in slower page load times. You can make the owner field autocomplete
 to avoid the extra queries using the AutocompleteOwner configuration field
-L<https://docs.bestpractical.com/rt/4.4.4/RT_Config.html#AutocompleteOwners>.
+L<https://docs.bestpractical.com/rt/4.4.4/RT_Config.html#AutocompleteOwners>
+or use the OwnerReadonly field if editing is not required.
 
 It may be possible to improve query times for owner and other ACL checking
 inline edit queries by adding an index to the ACL table, but the cost and
diff --git a/share/html/Elements/RT__Ticket/ColumnMap b/share/html/Elements/RT__Ticket/ColumnMap
index 6e446bf030..b9c6e3b637 100644
--- a/share/html/Elements/RT__Ticket/ColumnMap
+++ b/share/html/Elements/RT__Ticket/ColumnMap
@@ -104,6 +104,12 @@ $COLUMN_MAP = {
         value     => sub { return $_[0]->QueueObj->Name },
         edit      => sub { return \($m->scomp('/Elements/SelectQueue', Default => $_[0]->Queue, Name => 'Queue', ShowNullOption => 0)) },
     },
+    OwnerReadonly =>  {
+        title     => 'Owner', # loc
+        attribute => 'Owner',
+        value     => sub { return sprintf('%s (%s)',$_[0]->OwnerObj->Name, $_[0]->OwnerObj->RealName) },
+
+    },
     OwnerName => {
         title     => 'Owner', # loc
         attribute => 'Owner',
diff --git a/share/html/Search/Elements/BuildFormatString b/share/html/Search/Elements/BuildFormatString
index 09865e60b4..bda22ab32d 100644
--- a/share/html/Search/Elements/BuildFormatString
+++ b/share/html/Search/Elements/BuildFormatString
@@ -151,7 +151,7 @@ else {
         Status ExtendedStatus UpdateStatus
         Type
 
-        OwnerName Requestors Cc AdminCc CreatedBy LastUpdatedBy
+        OwnerName OwnerReadonly Requestors Cc AdminCc CreatedBy LastUpdatedBy
 
         Priority InitialPriority FinalPriority
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list