cacheSize of createSequence is ignored
See original GitHub issueEnvironment
Liquibase Version: 4.4.3
Liquibase Integration & Version: quarkus 2.3.0.Final
Liquibase Extension(s) & Version: liquibase-core only
Database Vendor & Version: MariaDB 10.6.4
Operating System Type & Version: Windows 10
Description
The Attribute cacheSize
of createSequence
seems to be ignored.
Steps To Reproduce
Run the following changesets:
<changeSet id="working" author="mickroll">
<createSequence sequenceName="SEQ_WORKING"
startValue="10000000"
incrementBy="1" />
<sql dbms="mysql,mariadb">ALTER SEQUENCE SEQ_WORKING CACHE=5;</sql>
</changeSet>
<changeSet id="attribute" author="mickroll">
<createSequence sequenceName="SEQ_SET"
startValue="10000000"
incrementBy="1"
cacheSize="5" />
</changeSet>
<changeSet id="default" author="mickroll">
<createSequence sequenceName="SEQ_DEFAULT"
startValue="10000000"
incrementBy="1" />
</changeSet>
- changeset
working
shows the wanted end result - changeset
attribute
shows usage ofcreateSequence cacheSize
(which will be ignored) - changeset
default
shows the default value ofcacheSize
(as defined by the database, i guess)
Now run the following SQL on the database to extract the results (or view the created sequences in the db client of our choice):
SELECT (SELECT cache_size FROM SEQ_WORKING) AS "working",
(SELECT cache_size FROM SEQ_SET) AS "set with attribute",
(SELECT cache_size FROM SEQ_DEFAULT) AS "default";
Actual Behavior
working = 5
(as expected)set with attribute = 1000
(bug)default = 1000
(shows default value)
Expected/Desired Behavior
set with attribute = 5
(as defined by the attributecacheSize
ofcreateSequence
tag)
Screenshots (if appropriate)
Additional Context
Doesn’t work, either: <alterSequence sequenceName="SEQ_SET" cacheSize="5"/>
┆Issue is synchronized with this Jira Story by Unito
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
createSequence | Liquibase Docs
The createSequence changetype creates a new database sequence. ... cacheSize, Number of values to fetch per query, asany, db2, db2z, derby, h2, hsqldb, ......
Read more >SEQUENCE Cache - Ask TOM
Now we have seen sequence contention.can we avoid it by increasing cache size to 2000 or 3000 ??? CREATE SEQUENCE SEQ_batch_inst1
Read more >How does the CACHE option of CREATE SEQUENCE work?
This paragraph in the doc is very helpful: For an example, a new sequence is created with a starting value of 1 and...
Read more >Cluster.Sequence.createSequence() - TIBCO Software
Creates a sequence across the cluster. If the sequence already exists, the call is ignored internally. Parameters. Name, Type, Description. sequenceName ...
Read more >sql server - Sequence - NO CACHE vs CACHE 1
I used this code to test for no cache and cache size of 1 and 4. ... CAST(@@SPID AS NVARCHAR(max))); EXEC (@S); GO...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It may be better to have more function checks like that vs instanceof. The trouble is that there is sort of an unlimited variation in what features are supported and not supported across the databases and also we hit variations in the SQL to generate depending on the database as well.
We’re looking at some refactoring to make that all work better, but it’s a medium-term project. In the meantime, I opened a PR that handles it the current way.
Thank you!