<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Thu Feb 08 23:10:06 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-1002] Use an IDENTITY columns instead of UUIDs for primary keys</title>
                <link>https://folio-org.atlassian.net/browse/FOLIO-1002</link>
                <project id="10290" key="FOLIO">FOLIO</project>
                    <description>&lt;p&gt;I think it would better if the tables in FOLIO used IDENTITY columns instead of UUIDs. I noticed this in the users module, but, it is more of a general issue. In the case of the user module it might not make that much of a difference performance-wise, since the number of users in the system probably won&apos;t be that great. However, as a general rule, I think it is not a good idea to use random values as primary keys. The primary key column has a clustered index. Normally, you want the ids in sequential order, or the DBMS may need to shift the rows around upon INSERT. This is probably more of an issue for something like a bibs table where you have millions of rows. But, it would be good if the system used identity columns across the board. An added advantage is that the ids take less space on disk. Also, they are easier to work with in terms of searching. An INT value is easier to type in that a long hexadecimal string. It would also be good if FOLIO upgraded to PostgreSQL 10 which supports identity columns using the standard SQL syntax.&lt;/p&gt;</description>
                <environment></environment>
        <key id="80413">FOLIO-1002</key>
            <summary>Use an IDENTITY columns instead of UUIDs for primary keys</summary>
                <type id="10002" iconUrl="https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10322?size=medium">New Feature</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="10000">Won&apos;t Do</resolution>
                                                        <assignee accountid="-1">Unassigned</assignee>
                                                                <reporter accountid="557058:c2706f9e-f281-4999-8937-b5c5a8ff211f">Jon Miller</reporter>
                                    <labels>
                    </labels>
                <created>Sun, 31 Dec 2017 22:25:22 +0000</created>
                <updated>Mon, 13 Jul 2020 17:00:48 +0000</updated>
                            <resolved>Mon, 13 Jul 2020 17:00:48 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                <comments>
                                                            <comment id="189285" author="5ee89462f7aa140abd82d11d" created="Tue, 2 Jan 2018 15:44:03 +0000"  >&lt;p&gt;FOLIO will use Postgresql 10 because raml-module-builder (version 16.0.4 and later) has been updated to use Postgresql 10.&lt;/p&gt;</comment>
                                                            <comment id="189287" author="557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d" created="Fri, 23 Feb 2018 21:01:51 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ac2706f9e-f281-4999-8937-b5c5a8ff211f&quot; class=&quot;user-hover&quot; rel=&quot;557058:c2706f9e-f281-4999-8937-b5c5a8ff211f&quot; data-account-id=&quot;557058:c2706f9e-f281-4999-8937-b5c5a8ff211f&quot; accountid=&quot;557058:c2706f9e-f281-4999-8937-b5c5a8ff211f&quot; rel=&quot;noreferrer&quot;&gt;Jon Miller&lt;/a&gt; Conveniece aside, do you have any Postgres benchmark results that you can point that supports your claim that native UUID PK has worse performance compared to SEQUENCE/IDENTITY?&lt;/p&gt;</comment>
                                                            <comment id="189288" author="557058:c2706f9e-f281-4999-8937-b5c5a8ff211f" created="Fri, 23 Feb 2018 21:11:49 +0000"  >&lt;p&gt;Not at the moment, but, I could do a test.&lt;/p&gt;</comment>
                                                            <comment id="189290" author="557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d" created="Fri, 23 Feb 2018 22:15:30 +0000"  >&lt;p&gt;It might me interesting to see what the overhead is (if any). The randomness is not really a problem since UUIDs are timestamp based and effectively sequential (that&apos;s only relevant to the scenario when they are autogen). Short comparison:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://blog.codinghorror.com/primary-keys-ids-versus-guids/&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://blog.codinghorror.com/primary-keys-ids-versus-guids/&lt;/a&gt;&lt;/p&gt;</comment>
                                                            <comment id="189292" author="557058:c2706f9e-f281-4999-8937-b5c5a8ff211f" created="Sat, 24 Feb 2018 13:44:31 +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; told me that PostgreSQL doesn&apos;t cluster indexes like some other databases do, such as SQL Server. So, I think it probably isn&apos;t an issue. It looks like if you want to cluster the data, it is done manually &lt;a href=&quot;https://www.postgresql.org/docs/current/static/sql-cluster.html&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.postgresql.org/docs/current/static/sql-cluster.html&lt;/a&gt;. It says it doesn&apos;t do it automatically. It appears that there are different UUID algorithms that can be use in PostgreSQL &lt;a href=&quot;https://www.postgresql.org/docs/9.5/static/uuid-ossp.html&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.postgresql.org/docs/9.5/static/uuid-ossp.html&lt;/a&gt;. I guess some are random and some aren&apos;t. mod-users appears to be using a random one.&lt;/p&gt;

&lt;p&gt;CREATE TABLE IF NOT EXISTS myuniversity_mymodule.users (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), jsonb JSONB NOT NULL);&lt;/p&gt;

&lt;p&gt;However, since it doesn&apos;t do clustering, I don&apos;t think it matters anyway. But, that is just a default anyway. A client could provide it&apos;s own value and I guess could use whatever algorithm it wants.&lt;/p&gt;

&lt;p&gt;Mainly, I was concerned about the tables that have millions of rows in them. I just noticed that the mod-inventory-storage module is already using identity values. &lt;/p&gt;

&lt;p&gt;CREATE TABLE schema_name.instance (_id SERIAL PRIMARY KEY, jsonb JSONB NOT NULL);&lt;/p&gt;

&lt;p&gt;Long story short, I doubt it&apos;s a problem.&lt;/p&gt;</comment>
                                                            <comment id="189294" author="557058:c2706f9e-f281-4999-8937-b5c5a8ff211f" created="Sat, 24 Feb 2018 14:20:16 +0000"  >&lt;p&gt;The fact that it&apos;s using a 128-bit value when you may only need something smaller like a 32-bit value may slow things down some. It was mainly the clustering that I was wondering about. Maybe it would still be best to set the default to one of the sequential UUID generators. However, it looked like maybe you needed to compile or add an additional module for the other ones. Maybe that&apos;s why the random one was chosen. I&apos;m amazed that as far as I know unsigned integers aren&apos;t part of the SQL standard.&lt;/p&gt;</comment>
                                                            <comment id="189296" author="557058:c2706f9e-f281-4999-8937-b5c5a8ff211f" created="Thu, 19 Apr 2018 11:58:15 +0000"  >&lt;p&gt;There are a couple other issues with regard to the UUIDs. One of them is that we would like to preserve the id values for a number of tables in our existing system. Also, I&apos;ve talked to a number of people and everyone I talked to said that they don&apos;t like the UUIDs in terms of being able to communicate them to other people. Smaller integer values are a lot easier to work with. The issues isn&apos;t just with speed. It has to do with ease of use as well. The values are also wasteful of screen real estate. For example, a lot of times in reports you will include the id value as a column in the output. A 36 character string wastes a lot of space. It is also difficult at a glance to to compare one UUID from another. Also, performance-wise, you have to consider that the 128-bit values can appear in foreign keys, not just primary keys which wastes additional space.&lt;/p&gt;</comment>
                                                            <comment id="189297" author="5ee89462f7aa140abd82d11d" created="Fri, 14 Feb 2020 14:43:54 +0000"  >&lt;blockquote&gt;&lt;p&gt;preserve the id values for a number of tables in our existing system.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Please create a separate issue for each table where a field to store the former identifier is missing.&lt;/p&gt;

&lt;p&gt;bq .everyone I talked to said that they don&apos;t like the UUIDs in terms of being able to communicate them to other people.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;in reports you will include the id value as a column in the output&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The UUID id primary key is not intended for humans. We have human readable ids (HRIDs), for example UXPROD-884.&lt;/p&gt;

&lt;p&gt;Please create a separate issue for each table where no HRID exists.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The values are also wasteful of screen real estate.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Please create a separate issue for each screen where space is wasted by a UUID.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Also, performance-wise, you have to consider that the 128-bit values can appear in foreign keys&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I cannot imagine that this tiny performance loss has any significant impact in real life scenarios. Can you post the numbers of your foreign key performance comparison 128-bit UUID vs. 32-bit INT?&lt;/p&gt;</comment>
                                                            <comment id="189300" author="5af5e627525ba96b58654f12" created="Mon, 13 Jul 2020 16:14:26 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ac2706f9e-f281-4999-8937-b5c5a8ff211f&quot; class=&quot;user-hover&quot; rel=&quot;557058:c2706f9e-f281-4999-8937-b5c5a8ff211f&quot; data-account-id=&quot;557058:c2706f9e-f281-4999-8937-b5c5a8ff211f&quot; accountid=&quot;557058:c2706f9e-f281-4999-8937-b5c5a8ff211f&quot; rel=&quot;noreferrer&quot;&gt;Jon Miller&lt;/a&gt; Looks like Ian has indicated that you should create separate issues for the various tables. If you do, please create them in the correct Jira projects and assign to the appropriate Dev Teams/POs. Here&apos;s the Dev team assignments: &lt;a href=&quot;https://folio-org.atlassian.net/wiki/display/REL/Team+vs+module+responsibility+matrix&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://folio-org.atlassian.net/wiki/display/REL/Team+vs+module+responsibility+matrix&lt;/a&gt;, and here&apos;s the PO assignments: &lt;a href=&quot;https://folio-org.atlassian.net/wiki/display/COMMUNITY/Directory+of+Product+Owners+by+Area+of+Focus&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://folio-org.atlassian.net/wiki/display/COMMUNITY/Directory+of+Product+Owners+by+Area+of+Focus&lt;/a&gt;&lt;/p&gt;</comment>
                                                            <comment id="189301" author="557058:c2706f9e-f281-4999-8937-b5c5a8ff211f" created="Mon, 13 Jul 2020 16:35:47 +0000"  >&lt;p&gt;This one is a really old one. It can probably just be closed out. I don&apos;t see this changing at this point.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="56844">RMB-114</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56876">RMB-128</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="55827">MODINVSTOR-170</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="47032">UIIN-292</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="47035">UIIN-294</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_10057" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Development Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10144"><![CDATA[Core: Platform]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10019" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|hzy5xr:</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, 2 Jan 2018 15:44:03 +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>