<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Thu Feb 08 23:10:38 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-1072] Add holdings and items to performance-testing system</title>
                <link>https://folio-org.atlassian.net/browse/FOLIO-1072</link>
                <project id="10290" key="FOLIO">FOLIO</project>
                    <description></description>
                <environment></environment>
        <key id="80592">FOLIO-1072</key>
            <summary>Add holdings and items to performance-testing system</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>ci</label>
                            <label>sprint32</label>
                            <label>sprint33</label>
                            <label>sprint34</label>
                    </labels>
                <created>Tue, 20 Feb 2018 16:20:25 +0000</created>
                <updated>Mon, 12 Nov 2018 14:24:06 +0000</updated>
                            <resolved>Thu, 22 Mar 2018 01:43:23 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                    <timespent seconds="31500">1 day, 45 minutes</timespent>
                                <comments>
                                                            <comment id="189703" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Tue, 20 Feb 2018 19:34:46 +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;br/&gt;
so the below works as follows , it isnt correct so it needs a small tweak. &lt;/p&gt;

&lt;p&gt;the holdings_record has in instanceId which is generated as follows: generate_series(10000000, 13000001) || &apos;-a3e4-465c-82f1-acade4e8e170&apos;&lt;/p&gt;

&lt;p&gt;the instance table&apos;s id is also generated in the same manner: generate_series(10000000, 13000001) || &apos;-a3e4-465c-82f1-acade4e8e170&apos;&lt;/p&gt;

&lt;p&gt;this creates a single holdings record with a reference to the id of a single instance - 3M times&lt;/p&gt;

&lt;p&gt;also , the items table generates a permanentLocationId using the same: generate_series(10000000, 13000001) || &apos;-a3e4-465c-82f1-acade4e8e170&apos;&lt;/p&gt;

&lt;p&gt;which is of course incorrect, so that would need fixing, but that is the gist of the scripts below&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;  INSERT INTO cql7_mod_inventory_storage.holdings_record
  SELECT id, 
  jsonb_build_object(
	&apos;id&apos;, id, 
	&apos;instanceId&apos;, instance_id , 
	&apos;permanentLocationId&apos; ,  permanentLocationId)
  FROM (select gen_random_uuid() AS id , generate_series(10000000, 13000001) || &apos;-a3e4-465c-82f1-acade4e8e170&apos; as instance_id , 
        &apos;d9cd0bed-1b49-4b5e-a7bd-064b8d17723&apos; || trunc(random() * 9) as permanentLocationId) as alias;   
  

  INSERT INTO cql7_mod_inventory_storage.instance
  SELECT id, 
  jsonb_build_object(
      &apos;id&apos;, id, 
      &apos;title&apos;, title, 
      &apos;source&apos; , source, 
      &apos;edition&apos; , edition, 
      &apos;instanceTypeId&apos; , &apos;2b94c631-fca9-a892-c730-03ee529ffe2c&apos;,
  	  &apos;creators&apos;, json_build_array(jsonb_build_object(&apos;name&apos;, &apos;ari sigal&apos; , &apos;creatorTypeId&apos; , &apos;2b94c631-fca9-a892-c730-03ee529ffe2a&apos;)))
  FROM (select (generate_series(10000000, 13000001) || &apos;-a3e4-465c-82f1-acade4e8e170&apos;)::uuid AS id ,
        (md5(random()::text)) || &apos; l&#246;rd the root  &apos;  || (md5(random()::text)) AS title,
        (md5(random()::text)) as source,  trunc(random() * 20) || &apos; ed.&apos; as edition) as alias;   
  

  INSERT INTO cql7_mod_inventory_storage.item
  SELECT id, 
  jsonb_build_object(
      &apos;id&apos;, id, 
      &apos;barcode&apos; ,  barcode , 
      &apos;status&apos; , jsonb_build_object(&apos;name&apos;, barcode || &apos;21ag&apos;),     
      &apos;materialTypeId&apos; , &apos;1c302429-5d78-4f8b-a367-3437bf1ab56e&apos;, 
      &apos;permanentLoanTypeId&apos;, &apos;2c302429-5d78-4f8b-a367-3437bf1ab56e&apos;,
  	  &apos;temporaryLoanTypeId&apos;, &apos;2c302429-5d78-4f8b-a367-3437bf1ab56e&apos;, 
      &apos;title&apos;, title, 
      &apos;permanentLocationId&apos; , permanentLocationId)
  FROM (select gen_random_uuid() AS id , 
        trunc(random() * 200000) || &apos;g&apos; AS barcode,  
        ((md5(random()::text)) || &apos; zeev shalev &apos;  || (md5(random()::text))) AS title,
        (generate_series(10000000, 13000001) || &apos;-a3e4-465c-82f1-acade4e8e170&apos;)::uuid AS permanentLocationId) as alias;   

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                                                            <comment id="189704" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Wed, 21 Feb 2018 07:53:52 +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; = sorry, had a brain lapse -  the above wont help much as the instance ids already exist... will update&lt;/p&gt;</comment>
                                                            <comment id="189706" author="712020:32bb56ac-50e7-4787-b4af-ed3089d9401c" created="Wed, 21 Feb 2018 11:46:24 +0000"  >&lt;p&gt;ok, this is should work pretty well - i was able to insert 1M in about 15 seconds&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;   INSERT INTO harvard5_mod_inventory_storage.holdings_record( _id, jsonb ) 
	SELECT gen_random_uuid() ,jsonb_build_object(
        &apos;id&apos;,  gen_random_uuid(),
        &apos;instanceId&apos;,  jsonb-&amp;gt;&amp;gt;&apos;id&apos;,
        &apos;callNumber&apos;, jsonb-&amp;gt;&amp;gt;&apos;instanceTypeId&apos;) FROM harvard5_mod_inventory_storage.instance limit 1000000;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;however, this will create a different uuid in the record then the one in the _id column - not sure it matters for the demo, but if it does, you can remove the _id from the insert statement and add the following trigger (there may be a simple way to do it without the trigger, didnt dig too deeply into 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;  CREATE OR REPLACE FUNCTION ${myuniversity}_${mymodule}.set_id_injson_${table.tableName}()
  RETURNS TRIGGER AS $$
  DECLARE
    injectedId text;
  BEGIN
    injectedId = &apos;&quot;&apos;||NEW.${table.pkColumnName}||&apos;&quot;&apos;;
    NEW.jsonb = jsonb_set(NEW.jsonb, &apos;{id}&apos; ,  injectedId::jsonb , true);
      RETURN NEW;
  END;
  $$ language &apos;plpgsql&apos;;
  CREATE TRIGGER set_id_injson_${table.tableName} BEFORE INSERT OR UPDATE ON ${myuniversity}_${mymodule}.${table.tableName} FOR EACH ROW EXECUTE PROCEDURE ${myuniversity}_${mymodule}.set_id_injson_${table.tableName}();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                                                            <comment id="189707" author="5c706fbb47a54a6728e59df2" created="Thu, 22 Mar 2018 01:42:48 +0000"  >&lt;p&gt;Holdings and items are loaded into folio-perf.aws.indexdata.com&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="80581">FOLIO-1066</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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|hzyax3:</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>Tue, 20 Feb 2018 19:34:46 +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>