H2 10x Slower Than HSQLDB And 6x Than Apache Derby For Specific ...
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} h2database / h2database Public 
tbalashovopened on Apr 27, 2018
- Notifications You must be signed in to change notification settings
- Fork 1.3k
- Star 4.6k
- Code
- Issues 385
- Pull requests 27
- Actions
- Projects 0
- Security
Uh oh!
There was an error while loading. Please reload this page.
- Insights
Description
This is a benchmark based on real life query which shows some performance issue. Profiler shows several hotspots in org.h2.util.ValueHashMap class.
package test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.Statement; public class GroupByDistinctBenchmark { public static void main(String[] args) throws Exception { Connection c = DriverManager.getConnection("jdbc:h2:file:/tmp/test"); // Connection c = DriverManager.getConnection("jdbc:hsqldb:file:/tmp/test"); // Connection c = DriverManager.getConnection("jdbc:derby:/tmp/test"); Statement st = c.createStatement(); // create and populate test table st.execute("create table tst (a double, b double)"); PreparedStatement ps = c.prepareStatement("insert into tst values (?, ?)"); for (int i = 1; i <= 3_000_000; i++) { ps.setDouble(1, i); ps.setDouble(2, i); ps.addBatch(); if (i % 10000 == 0) ps.executeBatch(); } ps.close(); st.execute("create index tst_a_idx on tst (a)"); // benchmark long start = System.nanoTime(); st.executeQuery("select a, sum(b) from (select distinct a, b from tst) as t group by a"); long elapsed = System.nanoTime() - start; System.out.println(elapsed / 1_000_000_000.0); c.close(); } }Approximate timings on my pc:
- H2: 180s
- HSQLDB: 18s
- Derby: 30s
Metadata
Metadata
Assignees
No one assignedLabels
No labelsNo labelsType
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
You can’t perform that action at this time.Từ khóa » H2 Vs Hsqldb
-
Which Is Better H2 Or HSQLDB? [closed] - Stack Overflow
-
System Properties Comparison H2 Vs. HyperSQL - DB-Engines
-
H2 Database Vs HSQLDB | What Are The Differences? - StackShare
-
Hibernate & H2 Vs Hibernate & HSQLDB Embedded
-
List Of In-Memory Databases | Baeldung
-
Performance - H2 Database Engine
-
JOOQ Tuesdays: Thomas Müller Unveils How HSQLDB Evolved Into ...
-
[h2] H2 Vs HSQLDB With Hibernate Comparison
-
Which Is Better H2 Or HSQLDB? [closed] - Codegrepr
-
HSQLDB And H2 Database Comparison - Krybot
-
Spring Boot And H2 In Memory Database - Why, What And How ...
-
HSQLDB
-
[PPT] Embedded Database Benchmark