<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Thu Feb 08 23:10:14 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>FOLIO Jira</title>
    <link>https://folio-org.atlassian.net</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>1001.0.0-SNAPSHOT</version>
        <build-number>100246</build-number>
        <build-date>07-02-2024</build-date>
    </build-info>

<item>
            <title>[FOLIO-1019] Inventory performance optimization for folio-alpha</title>
                <link>https://folio-org.atlassian.net/browse/FOLIO-1019</link>
                <project id="10290" key="FOLIO">FOLIO</project>
                    <description>&lt;p&gt;Create new indexes, database configuration tweaks, update queries, etc.&lt;/p&gt;</description>
                <environment></environment>
        <key id="80479">FOLIO-1019</key>
            <summary>Inventory performance optimization for folio-alpha</summary>
                <type id="10003" iconUrl="https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium">Task</type>
                                            <priority id="10002" iconUrl="https://dev.folio.org/assets/jira-priority/jira-p3.svg">P3</priority>
                        <status id="6" iconUrl="https://folio-org.atlassian.net/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10003">Done</resolution>
                                                        <assignee accountid="5c706fbb47a54a6728e59df2">Wayne Schneider</assignee>
                                                                <reporter accountid="5c706fbb47a54a6728e59df2">Wayne Schneider</reporter>
                                    <labels>
                            <label>alpha</label>
                            <label>ci</label>
                            <label>core</label>
                            <label>sprint30</label>
                            <label>sprint31</label>
                            <label>sprint32</label>
                    </labels>
                <created>Tue, 9 Jan 2018 21:58:41 +0000</created>
                <updated>Mon, 12 Nov 2018 14:23:55 +0000</updated>
                            <resolved>Wed, 14 Feb 2018 16:15:42 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                    <timespent seconds="108000">3 days, 6 hours</timespent>
                                <comments>
                                                            <comment id="189339" author="5c706fbb47a54a6728e59df2" created="Wed, 10 Jan 2018 21:16:53 +0000"  >&lt;p&gt;After much experimenting with different indexes, we have come to a few conclusions:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;we need to change the UI to search on &quot;publication&quot;, not &quot;publishers&quot; (and &quot;publisher&quot; needs to be the first property in the serialised JSON)&lt;/li&gt;
	&lt;li&gt;we need name to be the first property in contributors in the serialised JSON&lt;/li&gt;
	&lt;li&gt;we believe that sorting needs to be restricted to a single property, in order to limit the combinations (and hence indexes we need)&lt;/li&gt;
	&lt;li&gt;assuming single property sorting, we need b-tree indexes for title, contributors and publication&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Open questions:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Can the &quot;like&quot; indexes be dropped?&lt;/li&gt;
	&lt;li&gt;Anything else needed for search performance?&lt;/li&gt;
&lt;/ul&gt;
</comment>
                                                            <comment id="189340" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Thu, 11 Jan 2018 06:55:27 +0000"  >&lt;p&gt;hi &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5c706fbb47a54a6728e59df2&quot; class=&quot;user-hover&quot; rel=&quot;5c706fbb47a54a6728e59df2&quot; data-account-id=&quot;5c706fbb47a54a6728e59df2&quot; accountid=&quot;5c706fbb47a54a6728e59df2&quot; rel=&quot;noreferrer&quot;&gt;Wayne Schneider&lt;/a&gt; - was going to try this myself , but i didnt want to apply new rules to the db because i didnt know what was in the queue (i created a security group to open my ip to the db - hope that was ok - but i deleted the security group because i did not want to apply immediately) - having said that, if you can maybe try to run the following - it will tell us which indexes are being used and which have not (look at the idx_scan column)&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;
SELECT *, pg_size_pretty(pg_relation_size(&apos;diku_mod_inventory_storage.instance&apos;))
 FROM pg_stat_all_indexes 
 WHERE schemaname = &apos;diku_mod_inventory_storage&apos; 
 ORDER BY pg_relation_size(&apos;diku_mod_inventory_storage.instance&apos;) DESC, idx_scan ASC
 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;getting that output would be interesting&lt;/p&gt;</comment>
                                                            <comment id="189343" author="5bffed5e2434bf3a1a91d37a" created="Thu, 11 Jan 2018 11:29:49 +0000"  >&lt;p&gt;I think it would be appropriate to at least try and performance test a regular relational structure (like for response time, cpu/memory usage, indices disk space usage  etc) with and without multi-column sorting and what other features we&apos;re contemplating.&lt;/p&gt;

&lt;p&gt;If we take searches/sorting by title, contributors, identifiers for instance - we could create contributors and identifier tables in place of the contributor/identifier json object arrays - and index them appropriately, something like this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
DROP TABLE IF EXISTS diku_mod_inventory_storage.instance_identifier;

CREATE TABLE diku_mod_inventory_storage.instance_identifier (
  _id uuid PRIMARY KEY,
  instance_id uuid REFERENCES diku_mod_inventory_storage.instance (_id), 
  identifier_type_id uuid REFERENCES diku_mod_inventory_storage.identifier_type (_id), 
  identifier text,
  CONSTRAINT unique_identifiers UNIQUE (identifier, identifier_type_id, instance_id)
);

DROP TABLE IF EXISTS diku_mod_inventory_storage.instance_contributor;

CREATE TABLE diku_mod_inventory_storage.instance_contributor (
  _id uuid PRIMARY KEY,
  instance_id uuid REFERENCES diku_mod_inventory_storage.instance (_id),
  contributor_type_id uuid REFERENCES diku_mod_inventory_storage.contributor_type (_id), 
  contributor_name_type_id uuid REFERENCES diku_mod_inventory_storage.contributor_name_type (_id), 
  primary_contributor &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;, 
  name text
);

CREATE UNIQUE INDEX instance_contributor_name_type_name_idx
                 ON diku_mod_inventory_storage.instance_contributor (name, contributor_name_type_id, instance_id) 
              WHERE contributor_type_id IS NULL;          

CREATE UNIQUE INDEX instance_contributor_type_name_type_name_idx 
                 ON diku_mod_inventory_storage.instance_contributor (name, contributor_name_type_id, contributor_type_id, instance_id) 
              WHERE contributor_type_id IS NOT NULL;          
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The tables might be populated directly from the ingested JSON for testing (don&apos;t know how this SQL would work for millions of records though): &lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
INSERT INTO diku_mod_inventory_storage.instance_identifier (_id, instance_id, identifier_type_id, identifier)
SELECT gen_random_uuid(),
       instance_id, 
       REPLACE ( (jsonb_array_elements(ids)::json-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;identifierTypeId&apos;&lt;/span&gt;)::text, &lt;span class=&quot;code-quote&quot;&gt;&apos;&quot;&apos;&lt;/span&gt;, &apos;&apos;)::UUID  identifier_type_id,
       REPLACE ( (jsonb_array_elements(ids)::json-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;value&apos;&lt;/span&gt;)::text, &lt;span class=&quot;code-quote&quot;&gt;&apos;&quot;&apos;&lt;/span&gt;, &apos;&apos;) identifier
  FROM (SELECT _id instance_id, 
               jsonb-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt; AS ids 
          FROM diku_mod_inventory_storage.instance) AS identifiers;

INSERT INTO diku_mod_inventory_storage.instance_contributor (_id, instance_id, contributor_type_id, contributor_name_type_id, name)
SELECT gen_random_uuid(),
       instance_id, 
       REPLACE ( (jsonb_array_elements(contribs)::json-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;contributorTypeId&apos;&lt;/span&gt;)::text, &lt;span class=&quot;code-quote&quot;&gt;&apos;&quot;&apos;&lt;/span&gt;, &apos;&apos;)::UUID  contributor_type_id,
       REPLACE ( (jsonb_array_elements(contribs)::json-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;contributorNameTypeId&apos;&lt;/span&gt;)::text, &lt;span class=&quot;code-quote&quot;&gt;&apos;&quot;&apos;&lt;/span&gt;, &apos;&apos;)::UUID  contributor_name_type_id,
       REPLACE ( (jsonb_array_elements(contribs)::json-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;name&apos;&lt;/span&gt;)::text, &lt;span class=&quot;code-quote&quot;&gt;&apos;&quot;&apos;&lt;/span&gt;, &apos;&apos;) contributor_name
  FROM (SELECT _id instance_id, 
               jsonb-&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt; AS contribs 
          FROM diku_mod_inventory_storage.instance) AS contributors;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(Outstanding: the primary_contributor column not yet populated, could also have a flag indicating what contributor to sort by if there are multiple primary contributors, a table for instance publishers should also be created)&lt;/p&gt;

&lt;p&gt;In my small setup with only the sample data from mod-inventory-storage, I have these records, indexed by &apos;identifier&apos; and &apos;name&apos; respectively (if I understand postgresql indexes correctly) which I&apos;d expect would be a super fast entry for searching (not sure about the sorting):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
okapi_modules=# SELECT * 
okapi_modules-#   FROM diku_mod_inventory_storage.instance_identifier;
                 _id                  |             instance_id              |          identifier_type_id          |      identifier      
--------------------------------------+--------------------------------------+--------------------------------------+----------------------
 0933a4e9-7efd-4aca-967a-146920f9272f | 69640328-788e-43fc-9c3c-af39e243f3b7 | 913300b2-03ed-469a-8179-c1092c991227 | 0747-0088
 deb6a606-1220-40a8-9583-52b945af5a55 | 69640328-788e-43fc-9c3c-af39e243f3b7 | c858e4f2-2b6b-4385-842b-60732ee14abb | 84641839
 0e108f63-2da8-4ebf-97e2-defb4e30e896 | 30fcc8e7-a019-43f4-b642-2edc389f4501 | 593b78cb-32f3-44d1-ba8c-63fd5e6989e6 | AJMEAZ
 6fddd008-1919-4fc2-afa9-95a9e0314c1b | 30fcc8e7-a019-43f4-b642-2edc389f4501 | 913300b2-03ed-469a-8179-c1092c991227 | 0002-9343
 d3a4c0de-dff8-470d-a235-ed560be18600 | 30fcc8e7-a019-43f4-b642-2edc389f4501 | c858e4f2-2b6b-4385-842b-60732ee14abb | med49002270
 4b4c4687-febb-47b5-86e4-5a0733453f4c | 7fbd5d84-62d1-44c6-9c45-6cb173998bbd | 5d164f4b-0b15-4e42-ae75-cfcf85318ad9 | ocn956625961
 bdc976e9-627a-40af-889f-47c7e52bf823 | f31a36de-fcf8-44f9-87ef-a55d06ad21ae | 7f907515-a1bf-4513-8a38-92e1a07c539d | B01LO7PJOE
 70e1cae8-30cd-4043-9514-523607d2e7d4 | a89eccf0-57a6-495e-898d-32b9b2210f2f | 8261054f-be78-422d-bd51-4ed9f33c3422 | 0552142352
 50416f0c-7942-4fe9-a53e-26288a3af716 | a89eccf0-57a6-495e-898d-32b9b2210f2f | 8261054f-be78-422d-bd51-4ed9f33c3422 | 9780552142352
 89bb755d-146b-4674-a923-642d0c71dabf | 6506b79b-7702-48b2-9774-a1c538fdd34e | 8261054f-be78-422d-bd51-4ed9f33c3422 | 0956687695
 81f6f065-717d-496d-bdc5-a4d5b412ebf1 | 6506b79b-7702-48b2-9774-a1c538fdd34e | 8261054f-be78-422d-bd51-4ed9f33c3422 | 9780956687695
 287256da-bc2d-48c3-89e2-67d4077c2e6f | cf23adf0-61ba-4887-bf82-956c4aae2260 | 8261054f-be78-422d-bd51-4ed9f33c3422 | 1447294130
 c364068f-c166-470a-b573-c6ab76d311a6 | cf23adf0-61ba-4887-bf82-956c4aae2260 | 8261054f-be78-422d-bd51-4ed9f33c3422 | 9781447294130
 9e1e1ac2-a506-4a46-8953-c8b0b25646dd | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | 5d164f4b-0b15-4e42-ae75-cfcf85318ad9 | ocn968777846
 24410134-f5fa-4f5d-afa4-50daf00e8439 | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | 8261054f-be78-422d-bd51-4ed9f33c3422 | 9786316800312
 fdf3dce3-2757-4c24-a71c-5a416d0f748a | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | 8261054f-be78-422d-bd51-4ed9f33c3422 | 6316800312
 781fd59b-085f-4ddb-8029-683b5e53f5f2 | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | b5d8cdc4-9441-487c-90cf-0c7ec97728eb | OTA-1031 Ot&#225; Records
 67686153-c54e-4fd6-be5c-91b3948b183a | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | 7e591197-f335-4afb-bc6d-a6d76ca3bace | (OCoLC)968777846
(18 rows)

okapi_modules=# 
okapi_modules=# SELECT * 
okapi_modules-#   FROM diku_mod_inventory_storage.instance_contributor;
                 _id                  |             instance_id              |         contributor_type_id          |       contributor_name_type_id       | primary_contributor |         name         
--------------------------------------+--------------------------------------+--------------------------------------+--------------------------------------+---------------------+----------------------
 6ec264a7-c909-4ebd-8ed9-c4ed1ec76381 | 7fbd5d84-62d1-44c6-9c45-6cb173998bbd |                                      | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | Fielding, Helen
 b11ab3cf-622d-483f-badc-6e4034162575 | f31a36de-fcf8-44f9-87ef-a55d06ad21ae |                                      | 2e48e713-17f3-7c13-09f8-23845bb210aa |                     | Creator A
 17c81250-044b-46da-bd87-c2a6b4aa6ad5 | f31a36de-fcf8-44f9-87ef-a55d06ad21ae |                                      | e8b311a6-3b21-03f2-2269-dd9310cb2d0a |                     | Creator B
 9e136fae-9d41-4153-9501-3c86d1fdd00d | a89eccf0-57a6-495e-898d-32b9b2210f2f |                                      | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | Pratchett, Terry
 d3a491ab-9261-4b13-874f-72fd4e971bc1 | 6506b79b-7702-48b2-9774-a1c538fdd34e |                                      | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | Barnes, Adrian
 31745a13-1058-4ec6-a057-15ab73c3c098 | cf23adf0-61ba-4887-bf82-956c4aae2260 |                                      | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | Novik, Naomi
 ea443a06-b6a6-4985-a4d5-cf9bbe82b166 | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | 2b94c631-fca9-a892-c730-03ee529ffe2b | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | Sosa, Omar
 68fe6a2a-7c9f-4a7f-b024-19ce27c00bff | e54b1f4d-7d05-4b1a-9368-3c36b75d8ac6 | 2b94c631-fca9-a892-c730-03ee529ffe2b | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | Keita, Seckou, 1977-
 63515316-37fd-4953-90d1-e16d0b6c550e | bbd4a5e1-c9f3-44b9-bfdf-d184e04f0ba0 |                                      | 2b94c631-fca9-a892-c730-03ee529ffe2a |                     | White, Vincent E.
(9 rows)

okapi_modules=# 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


</comment>
                                                            <comment id="189348" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Thu, 11 Jan 2018 11:37:33 +0000"  >&lt;p&gt;hey &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5bffed5e2434bf3a1a91d37a&quot; class=&quot;user-hover&quot; rel=&quot;5bffed5e2434bf3a1a91d37a&quot; data-account-id=&quot;5bffed5e2434bf3a1a91d37a&quot; accountid=&quot;5bffed5e2434bf3a1a91d37a&quot; rel=&quot;noreferrer&quot;&gt;Niels Erik Nielsen&lt;/a&gt; - if i understood correctly, i am not sure it makes a difference to postgres if the btree comes from a separate column or from a field in the jsonb. at the end of the day the same index is created no matter what the source (column or field in jsonb) and response time should be identical. the issue with the multiple columns (or multi field, its the same) is just that postgres is very picky - you need to create an index for title+contrib and also for contrib+title , yes the ordering is important for the index to be used. you would also need the same for title+pub and pub+title  , and then also asc and desc matters here so that creates an awful lot of index to support the multi column sort - and at the end of the day this stuff really hurts scalability. if the added value of this is critical it can be supported by adding the indexes and it will perform well - i am just not sure it is....&lt;/p&gt;</comment>
                                                            <comment id="189350" author="5bffed5e2434bf3a1a91d37a" created="Thu, 11 Jan 2018 12:51:21 +0000"  >&lt;p&gt;But - this is not just from a separate column, no? rather from two new columns in two new separate tables? &lt;/p&gt;

&lt;p&gt;The entry into &apos;instance&apos; would be through the &apos;_id&apos; index only.&lt;/p&gt;

&lt;p&gt;Certainly not saying this means we would be home safe, just that it seemed sufficiently different from the current approach to potentially have other performance characteristics. &lt;/p&gt;</comment>
                                                            <comment id="189352" author="5bffed5e2434bf3a1a91d37a" created="Thu, 11 Jan 2018 12:54:16 +0000"  >&lt;p&gt;And, btw, this is a distraction, given this issue&apos;s title, &quot;.. for folio-alpha&quot;, sorry.&lt;/p&gt;</comment>
                                                            <comment id="189354" author="5c706fbb47a54a6728e59df2" created="Fri, 12 Jan 2018 15:14:05 +0000"  >&lt;p&gt;Conclusions from discussions on 1/11:&lt;br/&gt;
Output from pg_stat_all_indexes:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 relid  | indexrelid |         schemaname         | relname  |          indexrelname           | idx_scan | idx_tup_read | idx_tup_fetch | pg_size_pretty 
--------+------------+----------------------------+----------+---------------------------------+----------+--------------+---------------+----------------
 204521 |     204533 | diku_mod_inventory_storage | instance | instance_contributors_idx_like  |        0 |            0 |             0 | 3516 MB
 204521 |     347310 | diku_mod_inventory_storage | instance | instance_publication_idx        |        0 |            0 |             0 | 3516 MB
 204521 |     204531 | diku_mod_inventory_storage | instance | instance_title_idx_like         |        0 |            0 |             0 | 3516 MB
 204521 |     204527 | diku_mod_inventory_storage | instance | instance_pkey                   |        1 |            1 |             1 | 3516 MB
 204521 |     204532 | diku_mod_inventory_storage | instance | instance_identifiers_idx_like   |        2 |            0 |             0 | 3516 MB
 204521 |     347309 | diku_mod_inventory_storage | instance | instance_contributors_idx       |       19 |          750 |           750 | 3516 MB
 204521 |     347326 | diku_mod_inventory_storage | instance | instance_contrib_title_idx      |       38 |         2170 |          2170 | 3516 MB
 204521 |     204538 | diku_mod_inventory_storage | instance | instance_languages_idx_gin      |       88 |     49622320 |             0 | 3516 MB
 204521 |     204530 | diku_mod_inventory_storage | instance | instance_id_idx                 |      332 |          326 |           326 | 3516 MB
 204521 |     204537 | diku_mod_inventory_storage | instance | instance_instancetypeid_idx_gin |      444 |     50205382 |             0 | 3516 MB
 204521 |     204534 | diku_mod_inventory_storage | instance | instance_title_idx_gin          |      607 |      3924339 |             0 | 3516 MB
 204521 |     204535 | diku_mod_inventory_storage | instance | instance_contributors_idx_gin   |      607 |      3398622 |             0 | 3516 MB
 204521 |     204536 | diku_mod_inventory_storage | instance | instance_identifiers_idx_gin    |      619 |      2595910 |             0 | 3516 MB
 204521 |     204529 | diku_mod_inventory_storage | instance | instance_title_idx              |     1808 |     46971579 |      46971578 | 3516 MB
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Stats on the &quot;like&quot; indexes seem to indicate that they are not being used.&lt;/p&gt;

&lt;p&gt;Codex app provides search using the indexes ID, title, identifier, ISBN, ISSN, contributor, subject, classification, and publisher.&lt;/p&gt;

&lt;p&gt;These are the indexes we decided on for mod_inventory_storage.instance:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
  {
      &lt;span class=&quot;code-quote&quot;&gt;&quot;tableName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;instance&quot;&lt;/span&gt;,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;withMetadata&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;generateId&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;pkColumnName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;_id&quot;&lt;/span&gt;,
      &lt;span class=&quot;code-quote&quot;&gt;&quot;ginIndex&quot;&lt;/span&gt;: [
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;title&quot;&lt;/span&gt;,  &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; title search
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
     {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;contributors&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; contributors search
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;identifiers&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; identifiers search
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;instanceTypeId&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; type search (as a filter)
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;languages&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; languages search (as a filter)
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;classifications&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; CODEX classifications search
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;subjects&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; CODEX subjects search
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        }
      ],
      &lt;span class=&quot;code-quote&quot;&gt;&quot;index&quot;&lt;/span&gt;: [
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;title&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; title sort
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;id&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; join with holdings &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; location filter
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;contributors&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; contributors sort
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        },
        {
          &lt;span class=&quot;code-quote&quot;&gt;&quot;fieldName&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;publication&quot;&lt;/span&gt;, &amp;lt;------------- &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; publication sort
          &lt;span class=&quot;code-quote&quot;&gt;&quot;tOps&quot;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&quot;ADD&quot;&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;caseSensitive&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;false&lt;/span&gt;,
          &lt;span class=&quot;code-quote&quot;&gt;&quot;removeAccents&quot;&lt;/span&gt;: &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;
        }
      ]
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next steps:&lt;br/&gt;
Rebuild folio-alpha with latest code and new indexes. Reload records and test performance within the inventory app and with the Codex app.&lt;/p&gt;

&lt;p&gt;Does this sound right? &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3A32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; class=&quot;user-hover&quot; rel=&quot;712020:32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; data-account-id=&quot;712020:32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; accountid=&quot;712020:32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; rel=&quot;noreferrer&quot;&gt;shale99&lt;/a&gt; &amp;#8211; if you have any jmeter scripts put together, feel free to send them my way.&lt;/p&gt;</comment>
                                                            <comment id="189356" author="5c706fbb47a54a6728e59df2" created="Fri, 12 Jan 2018 15:22:51 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5bffed5e2434bf3a1a91d37a&quot; class=&quot;user-hover&quot; rel=&quot;5bffed5e2434bf3a1a91d37a&quot; data-account-id=&quot;5bffed5e2434bf3a1a91d37a&quot; accountid=&quot;5bffed5e2434bf3a1a91d37a&quot; rel=&quot;noreferrer&quot;&gt;Niels Erik Nielsen&lt;/a&gt; &amp;#8211; I think the discussion of db architecture is not a distraction. I also was thinking of supplemental tables that might be useful and more performant for sorting, e.g. a table of titles or of contributor names that you could use in joins with the UUID of the instance as the relational key. Of course, post-alpha, but we need to capture the ideas somewhere.&lt;/p&gt;</comment>
                                                            <comment id="189358" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Sun, 14 Jan 2018 06:45:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5c706fbb47a54a6728e59df2&quot; class=&quot;user-hover&quot; rel=&quot;5c706fbb47a54a6728e59df2&quot; data-account-id=&quot;5c706fbb47a54a6728e59df2&quot; accountid=&quot;5c706fbb47a54a6728e59df2&quot; rel=&quot;noreferrer&quot;&gt;Wayne Schneider&lt;/a&gt; - sounds good to me , i have started working on the jmeter - hope to have something to pass on to you tomorrow&lt;br/&gt;
just one more comment about the index usage - we can also see&lt;br/&gt;
idx_tup_read = 0 &lt;br/&gt;
idx_tup_fetch = 0&lt;br/&gt;
which &lt;em&gt;may&lt;/em&gt; strengthen the assumption that the like indexes are not need&lt;/p&gt;</comment>
                                                            <comment id="189360" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Sun, 14 Jan 2018 13:00:07 +0000"  >&lt;p&gt;hey &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5c706fbb47a54a6728e59df2&quot; class=&quot;user-hover&quot; rel=&quot;5c706fbb47a54a6728e59df2&quot; data-account-id=&quot;5c706fbb47a54a6728e59df2&quot; accountid=&quot;5c706fbb47a54a6728e59df2&quot; rel=&quot;noreferrer&quot;&gt;Wayne Schneider&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;i am attaching two files&lt;br/&gt;
1. jmeter script that can be run by jenkins - it runs a login request to folio-alpha (host is configurable) and then about 40 GET requests. most of them are queries (filters, sorting) but there are some requests to the configuration module as well. It generates two outputs&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;to the console - a summary with: (1) # of requests (2) average request time (3) min request time (4) max request time (5) error %  - we should set up an alert on the max and avg values&lt;/li&gt;
	&lt;li&gt;a csv file with the actual requests and the amount of time each request took, status of the request, latency, connection time, etc.. - i would send this file via mail at one point in case the average or max are higher than a threshold (sample csv attached - you need to change the path to the file in the .jmx file - i may be able to extract that into a variable but have not)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;right now , i see that the slowest request is actually not a double sort - but only a single sort on title - we need to see the explain for that:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;
query=((title=&quot;water*&quot; or contributors adj &quot;\&quot;name\&quot;: \&quot;water*\&quot;&quot; or identifiers adj &quot;\&quot;value\&quot;: \&quot;water*\&quot;&quot;)) and instanceTypeId=&quot;2b94c631-fca9-a892-c730-03ee529ffe2c&quot; and languages=&quot;eng&quot; sortby title/sort.descending

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;I will update the jmeter script to receive a file with queries and push those queries into a template so that we can run many queries on this via a list in an external file&lt;/p&gt;

&lt;p&gt;also, note that there is an email plugin that can send emails if we want to push out notifications on poor performance test results (&amp;lt;-recommended &lt;img class=&quot;emoticon&quot; src=&quot;/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;)&lt;/p&gt;</comment>
                                                            <comment id="189362" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Sun, 14 Jan 2018 21:53:59 +0000"  >&lt;p&gt;two new file attached, a new .jmx file - inventory_only_csv.jmx - will look for a csv file (need to change this path in the .jmx file &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;/rest/api/3/attachment/content/64011&quot; title=&quot;inventory_only_csv.jmx attached to FOLIO-1019&quot; data-attachment-type=&quot;file&quot; data-attachment-name=&quot;inventory_only_csv.jmx&quot; data-media-services-type=&quot;file&quot; data-media-services-id=&quot;53cbc08e-9b8d-494d-940a-557c54418294&quot; rel=&quot;noreferrer&quot;&gt;inventory_only_csv.jmx&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;  &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;/rest/api/3/attachment/content/64012&quot; title=&quot;inventory_queries.csv attached to FOLIO-1019&quot; data-attachment-type=&quot;file&quot; data-attachment-name=&quot;inventory_queries.csv&quot; data-media-services-type=&quot;file&quot; data-media-services-id=&quot;54df3b3d-c73f-45f4-84c7-666ec6f67e9d&quot; rel=&quot;noreferrer&quot;&gt;inventory_queries.csv&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; ) with a query per line - and will loop through all of them and return the same type of outputs as described above - attached a sample cvs file (inventory_queries.csv)&lt;/p&gt;

&lt;p&gt;will add the ability to do a full display dynamically of records returned from queries tomorrow &lt;/p&gt;</comment>
                                                            <comment id="189364" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Mon, 15 Jan 2018 08:01:46 +0000"  >&lt;p&gt;one more jmx script - this one is pretty cool - as you can use it to load the codex as well as the inventory&lt;/p&gt;

&lt;p&gt; &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;/rest/api/3/attachment/content/64009&quot; title=&quot;inventory_csv_with_fulldisplay.jmx attached to FOLIO-1019&quot; data-attachment-type=&quot;file&quot; data-attachment-name=&quot;inventory_csv_with_fulldisplay.jmx&quot; data-media-services-type=&quot;file&quot; data-media-services-id=&quot;b9eb2651-f624-4f8f-ac34-54176686361a&quot; rel=&quot;noreferrer&quot;&gt;inventory_csv_with_fulldisplay.jmx&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;

&lt;p&gt;first - you have the following set of variables&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;base url to the host&lt;/li&gt;
	&lt;li&gt;okapi tenant&lt;/li&gt;
	&lt;li&gt;origin header (same as host with http prefix)&lt;/li&gt;
	&lt;li&gt;query duration max&lt;/li&gt;
	&lt;li&gt;full display duration max&lt;/li&gt;
	&lt;li&gt;url path (this is the path to query, can be instance-storage/instances, or the codex path, etc...)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;second - pass in the csv file as attached in the previous script&lt;/p&gt;

&lt;p&gt;the script will &lt;br/&gt;
run each query from the csv &lt;br/&gt;
parse the json returned&lt;br/&gt;
pick a random id from the json&lt;br/&gt;
call a full display on that id&lt;/p&gt;

&lt;p&gt;if the requests take longer than the duration max limit or a non 200 response is returned an assertion failure will occur&lt;/p&gt;

&lt;p&gt;this means there are three current jmter scripts&lt;/p&gt;

&lt;p&gt;1. simulates the ui by running exactly what the ui runs (including config requests)&lt;br/&gt;
2. simulates just running queries from a csv file&lt;br/&gt;
3. simulates running queries and then a full display with the queries comming from the csv file&lt;/p&gt;

&lt;p&gt;i will tweak (1) so that it can also receive a file with terms&lt;/p&gt;</comment>
                                                            <comment id="189367" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Mon, 15 Jan 2018 14:19:37 +0000"  >&lt;p&gt;quick update, the csv has been updated to be comma delimited with offset and limit - see example attached. note that these are mandatory (at least on the first query, after that, for example the second entry in the csv, will use the previous offset and limit values)&lt;/p&gt;</comment>
                                                            <comment id="189369" author="5c706fbb47a54a6728e59df2" created="Tue, 16 Jan 2018 17:32:02 +0000"  >&lt;p&gt;We have identified a performance issue when you search for multiple terms in the typeahead search box on the UI, e.g. searching for &quot;golda m&quot;. This results in this CQL query:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
(title=&lt;span class=&quot;code-quote&quot;&gt;&quot;golda m*&quot;&lt;/span&gt; or contributors adj &lt;span class=&quot;code-quote&quot;&gt;&quot;\&quot;&lt;/span&gt;name\&lt;span class=&quot;code-quote&quot;&gt;&quot;: \&quot;&lt;/span&gt;golda m*\&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot; or identifiers adj &quot;&lt;/span&gt;\&lt;span class=&quot;code-quote&quot;&gt;&quot;value\&quot;&lt;/span&gt;: \&lt;span class=&quot;code-quote&quot;&gt;&quot;golda m*\&quot;&lt;/span&gt;&quot;) sortby title
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This CQL generates this SQL WHERE clause:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
WHERE (((lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)) AND lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))m.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))) OR (lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda([[:punct:]]|[[:space:]])+m.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))) OR (lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda([[:punct:]]|[[:space:]])+m.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;))) ORDER BY lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) LIMIT 30 OFFSET 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;...which performs very badly on folio-alpha.&lt;/p&gt;

&lt;p&gt;The troublesome part of the query is this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
(lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)) AND lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))m.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If this bit is changed to:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
(lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda([[:punct:]]|[[:space:]])+m.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Performance is very good.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3A32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; class=&quot;user-hover&quot; rel=&quot;712020:32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; data-account-id=&quot;712020:32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; accountid=&quot;712020:32bb56ac-50e7-4787-b4af-ed3089d9401c&quot; rel=&quot;noreferrer&quot;&gt;shale99&lt;/a&gt; says:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;the query is generated incorrectly with the space - it creates a separate AND clause which is incorrect and is very costly as the single letter causes the planner to use the btree index to first sort and then filter on the results - but since its an AND there are only a few results and its very slow&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;In addition, we found a possible issue with db configuration resulting in slower-than-desired IO (adding a second or more on to query result sorting). We&apos;re changing the storage type of the RDS instance to see if that will improve things &amp;#8211; but the query issue above has much greater impact.&lt;/p&gt;</comment>
                                                            <comment id="189370" author="5c706fbb47a54a6728e59df2" created="Tue, 16 Jan 2018 18:29:33 +0000"  >&lt;p&gt;Update: testing with &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63e2a2771b13d42998e4e706&quot; class=&quot;user-hover&quot; rel=&quot;63e2a2771b13d42998e4e706&quot; data-account-id=&quot;63e2a2771b13d42998e4e706&quot; accountid=&quot;63e2a2771b13d42998e4e706&quot; rel=&quot;noreferrer&quot;&gt;Marc Johnson&lt;/a&gt;, we found that the change in RMB 17 that makes &lt;tt&gt;adj&lt;/tt&gt; the default CQL relation for &lt;tt&gt;=&lt;/tt&gt; results in a better query:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
WHERE ((lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda([[:punct:]]|[[:space:]])+m.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;))) OR (lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda([[:punct:]]|[[:space:]])+m.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))) OR (lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda([[:punct:]]|[[:space:]])+m.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;))) ORDER BY lower(f_unaccent(instance.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) LIMIT 30 OFFSET 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Which returns very fast (&amp;lt; 500 ms in the UI). So once all the code is in the mainline, we should be in pretty good shape, right?&lt;/p&gt;</comment>
                                                            <comment id="189374" author="5c706fbb47a54a6728e59df2" created="Wed, 17 Jan 2018 23:15:28 +0000"  >&lt;p&gt;Open issues:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Search for a single non-western character is cripplingly slow (see 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;UIIN-69&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/UIIN-69&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Typeahead search should start with 3rd character for &amp;quot;contributors&amp;quot; and &amp;quot;identifiers&amp;quot;&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10322?size=medium&quot; /&gt;
            UIIN-69
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
)&lt;/li&gt;
	&lt;li&gt;Search for multiple short terms (e.g. &quot;new yo&quot;) is slower than it should be. Query analysis shows that the bitmap heap scan on folio-alpha, even with cached data, is slower than on a local PostgreSQL install, and CPU utilization as well as read IOPS spikes on the operation. We may try with a PostgreSQL install on an EC2 instance to see if we see the same behavior (current instance is RDS)&lt;/li&gt;
	&lt;li&gt;Search with multiple filters applied also appears slower than it should be. Haven&apos;t yet done query analysis on that.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                                                            <comment id="189378" author="5c706fbb47a54a6728e59df2" created="Thu, 1 Feb 2018 02:38:11 +0000"  >&lt;p&gt;With mod-inventory-storage-7.2.1-SNAPSHOT.73 (&lt;a href=&quot;https://github.com/folio-org/mod-inventory-storage/commit/6bc1b9c32cf23a559d62c99b8b25b1a94855d864&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-inventory-storage/commit/6bc1b9c32cf23a559d62c99b8b25b1a94855d864&lt;/a&gt;) and ui-inventory-1.0.100080 (&lt;a href=&quot;https://github.com/folio-org/ui-inventory/commit/5e634a0202664d9c303fed4239c48d7f48a1d83f&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/ui-inventory/commit/5e634a0202664d9c303fed4239c48d7f48a1d83f&lt;/a&gt;), which adds searching barcode to the typeahead search, search performance is really bad.&lt;/p&gt;

&lt;p&gt;Here is the CQL generated by the UI for the typeahead search:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
(title=&lt;span class=&quot;code-quote&quot;&gt;&quot;golda*&quot;&lt;/span&gt; or contributors adj &lt;span class=&quot;code-quote&quot;&gt;&quot;\&quot;&lt;/span&gt;name\&lt;span class=&quot;code-quote&quot;&gt;&quot;: \&quot;&lt;/span&gt;golda*\&lt;span class=&quot;code-quote&quot;&gt;&quot;&quot; or identifiers adj &quot;&lt;/span&gt;\&lt;span class=&quot;code-quote&quot;&gt;&quot;value\&quot;&lt;/span&gt;: \&lt;span class=&quot;code-quote&quot;&gt;&quot;golda*\&quot;&lt;/span&gt;&lt;span class=&quot;code-quote&quot;&gt;&quot; or item.barcode=&quot;&lt;/span&gt;golda*&quot;) sortby title
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This translates into this WHERE clause, according to the log:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
WHERE (((lower(f_unaccent(instance_holding_item_view.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;))) OR (lower(f_unaccent(instance_holding_item_view.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))) OR (lower(f_unaccent(instance_holding_item_view.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;)))) OR (lower(f_unaccent(instance_holding_item_view.it_jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;barcode&apos;&lt;/span&gt;)) ~ lower(f_unaccent(&lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;))) ORDER BY lower(f_unaccent(instance_holding_item_view.jsonb-&amp;gt;&amp;gt;&lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;)) LIMIT 30 OFFSET 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;EXPLAIN (ANALYZE, BUFFERS) for the query shows:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 Limit  (cost=1.49..67711.68 rows=30 width=1469) (actual time=9828.727..101728.613 rows=30 loops=1)
   Buffers: shared hit=1255688 read=195908
   -&amp;gt;  Nested Loop Left Join  (cost=1.49..8854237.51 rows=3923 width=1469) (actual time=9828.725..101728.584 rows=30 loops=1)
         Filter: ((lower(f_unaccent((instance.jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text) OR (lower(f_unaccent((instance.jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text) OR (lower(f_unaccent((instance.jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text) OR (lower(f_unaccent((item.jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;barcode&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text))
         Rows Removed by Filter: 625319
         Buffers: shared hit=1255688 read=195908
         -&amp;gt;  Nested Loop Left Join  (cost=1.08..2328365.55 rows=1796473 width=1373) (actual time=0.097..14632.255 rows=625348 loops=1)
               Buffers: shared hit=1108970 read=195908
               -&amp;gt;  Index Scan using instance_title_idx on instance  (cost=0.68..1403133.96 rows=1796473 width=1341) (actual time=0.021..9422.059 rows=625347 loops=1)
                     Buffers: shared hit=434698 read=195907
               -&amp;gt;  Index Scan using holdings_record_instanceid_idx on holdings_record  (cost=0.41..0.48 rows=4 width=32) (actual time=0.002..0.002 rows=0 loops=625347)
                     Index Cond: (lower(f_unaccent((instance.jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;id&apos;&lt;/span&gt;::text))) = lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;instanceId&apos;&lt;/span&gt;::text))))
                     Buffers: shared hit=625349
         -&amp;gt;  Index Scan using item_holdingsrecordid_idx on item  (cost=0.41..0.51 rows=3 width=32) (actual time=0.000..0.000 rows=0 loops=625348)
               Index Cond: (lower(f_unaccent((holdings_record.jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;id&apos;&lt;/span&gt;::text))) = lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;holdingsRecordId&apos;&lt;/span&gt;::text))))
               Buffers: shared hit=6
 Planning time: 72.537 ms
 Execution time: 101728.737 ms
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Interestingly, in the UI this took about 7 minutes (granted, I have a bad network connection right now, but not that bad), vs. 102 sec. using psql. Not sure how to explain that.&lt;br/&gt;
Applying a filter causes the query to be executed again, with extremely slow results.&lt;/p&gt;

&lt;p&gt;If I remove the barcode from the query and run it against just the instance table, I get:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
 Limit  (cost=3040.72..3040.79 rows=30 width=1413) (actual time=244.438..244.468 rows=30 loops=1)
   Buffers: shared hit=1259 read=1172
   -&amp;gt;  Sort  (cost=3040.72..3042.04 rows=530 width=1413) (actual time=244.436..244.460 rows=30 loops=1)
         Sort Key: (lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;::text))))
         Sort Method: top-N heapsort  Memory: 79kB
         Buffers: shared hit=1259 read=1172
         -&amp;gt;  Bitmap Heap Scan on instance  (cost=420.37..3025.07 rows=530 width=1413) (actual time=231.874..242.597 rows=75 loops=1)
               Recheck Cond: ((lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text) OR (lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text) OR (lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text))
               Rows Removed by Index Recheck: 53
               Heap Blocks: exact=128
               Buffers: shared hit=1259 read=1172
               -&amp;gt;  BitmapOr  (cost=420.37..420.37 rows=530 width=0) (actual time=231.447..231.447 rows=0 loops=1)
                     Buffers: shared hit=1112 read=1143
                     -&amp;gt;  Bitmap Index Scan on instance_title_idx_gin  (cost=0.00..61.34 rows=179 width=0) (actual time=29.525..29.525 rows=110 loops=1)
                           Index Cond: (lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;title&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))golda.*($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text)
                           Buffers: shared hit=19 read=28
                     -&amp;gt;  Bitmap Index Scan on instance_contributors_idx_gin  (cost=0.00..157.28 rows=171 width=0) (actual time=182.956..182.956 rows=64 loops=1)
                           Index Cond: (lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;contributors&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;name&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text)
                           Buffers: shared hit=1079 read=1094
                     -&amp;gt;  Bitmap Index Scan on instance_identifiers_idx_gin  (cost=0.00..201.35 rows=180 width=0) (actual time=18.961..18.961 rows=0 loops=1)
                           Index Cond: (lower(f_unaccent((jsonb -&amp;gt;&amp;gt; &lt;span class=&quot;code-quote&quot;&gt;&apos;identifiers&apos;&lt;/span&gt;::text))) ~ &lt;span class=&quot;code-quote&quot;&gt;&apos;(^|[[:punct:]]|[[:space:]]|(?=[[:punct:]]|[[:space:]]))&lt;span class=&quot;code-quote&quot;&gt;&quot;value&quot;&lt;/span&gt;:([[:punct:]]|[[:space:]])+&lt;span class=&quot;code-quote&quot;&gt;&quot;golda.*&quot;&lt;/span&gt;($|[[:punct:]]|[[:space:]]|(?&amp;lt;=[[:punct:]]|[[:space:]]))&apos;&lt;/span&gt;::text)
                           Buffers: shared hit=14 read=21
 Planning time: 15.046 ms
 Execution time: 246.780 ms
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So that&apos;s plenty fast.&lt;br/&gt;
Similar results if I run against the view but remove the barcode clause.&lt;/p&gt;</comment>
                                                            <comment id="189382" author="5c706fbb47a54a6728e59df2" created="Wed, 14 Feb 2018 16:15:42 +0000"  >&lt;p&gt;Closing this issue as the basic work is done...we can raise individual issues for creation of a performance testing environment, further development of a set of tests, setting up a baseline for measuring performance, and CI integration. At this point if there are particular performance problems we are working on, it makes sense to create issues for them.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="80581">FOLIO-1066</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="80438">FOLIO-986</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="46892">UIIN-69</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="79367">FOLIO-917</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="55716">MODINVSTOR-48</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="64008" name="inventory.jmx" size="287764" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Sun, 14 Jan 2018 13:01:57 +0000"/>
                            <attachment id="64009" name="inventory_csv_with_fulldisplay.jmx" size="28682" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Mon, 15 Jan 2018 14:23:32 +0000"/>
                            <attachment id="64010" name="inventory_jmeter_output.csv" size="26871" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Sun, 14 Jan 2018 13:01:54 +0000"/>
                            <attachment id="64011" name="inventory_only_csv.jmx" size="22857" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Sun, 14 Jan 2018 21:53:54 +0000"/>
                            <attachment id="64012" name="inventory_queries.csv" size="371" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Mon, 15 Jan 2018 14:17:55 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummarycf">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10019" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|hzy6vj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10020" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10024" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>[CHART] Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 11 Jan 2018 06:55:27 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10025" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>[CHART] Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>