[
https://issues.apache.org/jira/browse/DERBY-6841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15006063#comment-15006063
]
Rick Hillegas commented on DERBY-6841:
--------------------------------------
When I rolled back the development trunk to the subversion timestamp of the
10.11.1.1 release (1616546) but left the data dictionary version at 10.12.0.0
(as understood by DataDictionaryImpl and release.properties), then I saw the
same slow reboot times:
{noformat}
[/Users/rhillegas/derby/mainline/trunk/jars/insane/derby.jar] 10.12.0.0 alpha -
(1616546)
Booted database 0 average over 100 times = 125.74
Shutdown database 0 average over 100 times = 17.42
Shutdown engine average over 1 times = 5.0
{noformat}
However, as a follow-on experiment at the same subversion timestamp (1616546),
I then reset the data dictionary version to be 10.11.0.0. Then I saw the fast
reboot times:
{noformat}
[/Users/rhillegas/derby/mainline/trunk/jars/insane/derby.jar] 10.11.0.0 alpha -
(1616546M)
Booted database 0 average over 100 times = 17.32
Shutdown database 0 average over 100 times = 10.2
Shutdown engine average over 1 times = 6.0
{noformat}
As a further experiment, I hard-upgraded the database to version 10.12. This
brought down the reboot time too:
{noformat}
[/Users/rhillegas/sw/derby/lib-10.12.1.1/derby.jar] 10.12.1.1 - (1704137)
Booted database 0 average over 100 times = 19.42
Shutdown database 0 average over 100 times = 9.05
Shutdown engine average over 1 times = 8.0
{noformat}
I suspect that what DERBY_6841.java measures is the cost of the soft-upgrade of
the data dictionary every time that we reboot. Soft-upgrade causes
recompilation of various metadata queries.
Then I deleted the database and recreated it with 10.10. Rebooting with
10.11.1.1 and 10.12.1.1 was still slow, but not as slow as the original
experiment:
{noformat}
[/Users/rhillegas/sw/derby/lib-10.11.1.1/derby.jar] 10.11.1.1 - (1616546)
Booted database 0 average over 100 times = 69.74
Shutdown database 0 average over 100 times = 12.08
Shutdown engine average over 1 times = 4.0
[/Users/rhillegas/sw/derby/lib-10.12.1.1/derby.jar] 10.12.1.1 - (1704137)
Booted database 0 average over 100 times = 77.56
Shutdown database 0 average over 100 times = 13.13
Shutdown engine average over 1 times = 4.0
{noformat}
This suggests that 10.12 does more soft-upgrade on 10.11 databases than on
10.10 databases.
I recommend that you try the following:
1) Clone your database. You can do this by copying the database directory after
you bring down the Derby engine.
2) Hard upgrade your database clone. You can do this by booting the clone with
the upgrade=true attribute. Something like this:
jdbc:derby:tmpdbs/db0;upgrade=true
3) Then run your experiments on the hard-upgraded clone. It would be
interesting to see the results.
Thanks,
-Rick
> Derby v10.12.1.1 is horribly slow compared to v10.11.1.1 in embedded mode
> -------------------------------------------------------------------------
>
> Key: DERBY-6841
> URL: https://issues.apache.org/jira/browse/DERBY-6841
> Project: Derby
> Issue Type: Bug
> Components: JDBC, SQL
> Affects Versions: 10.12.1.1
> Environment: OS: Windows, OS X, Linux
> CPU: Quad-Core Intel i5
> App: Swing, multi-threaded
> Reporter: Xavion
> Fix For: 10.11.1.1
>
> Attachments: DERBY_6841.java
>
>
> It takes much longer to open, read, and close embedded databases using
> v10.12.1.1 than it did with v10.11.1.1. What ever changes you guys made over
> the last year and a bit have definitely been for the worse.
> Below are the results of the repetition tests I've just run on the same
> computer with the same databases. Let me know if you need to know about the
> sizes of the databases and/or the file type they contain.
> Connecting with v10.11.1.1:
> Database opened in 0.82 seconds.
> Database opened in 0.77 seconds.
> Database opened in 0.88 seconds.
> Database opened in 0.77 seconds.
> Database opened in 0.77 seconds.
> Database opened in 0.96 seconds.
> Database opened in 0.74 seconds.
> Connecting with v10.12.1.1:
> Database opened in 1.98 seconds.
> Database opened in 2.07 seconds.
> Database opened in 1.97 seconds.
> Database opened in 2.01 seconds.
> Database opened in 2.01 seconds.
> Database opened in 2.00 seconds.
> Database opened in 2.03 seconds.
> Reading with v10.11.1.1:
> Database processed in 6.17 seconds.
> Database processed in 4.00 seconds.
> Database processed in 3.67 seconds.
> Database processed in 3.66 seconds.
> Database processed in 3.78 seconds.
> Database processed in 3.69 seconds.
> Database processed in 3.74 seconds.
> Reading with v10.12.1.1:
> Database processed in 7.29 seconds.
> Database processed in 4.54 seconds.
> Database processed in 4.88 seconds.
> Database processed in 4.65 seconds.
> Database processed in 4.34 seconds.
> Database processed in 4.35 seconds.
> Database processed in 4.50 seconds.
> Disconnecting with v10.11.1.1:
> Database closed in 0.11 seconds.
> Database closed in 0.13 seconds.
> Database closed in 0.15 seconds.
> Database closed in 0.14 seconds.
> Database closed in 0.10 seconds.
> Database closed in 0.13 seconds.
> Database closed in 0.14 seconds.
> Disconnecting with v10.12.1.1:
> Database closed in 0.74 seconds.
> Database closed in 0.87 seconds.
> Database closed in 0.76 seconds.
> Database closed in 0.87 seconds.
> Database closed in 0.85 seconds.
> Database closed in 0.69 seconds.
> Database closed in 0.84 seconds.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)