question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parser is slow when parsing H2 query

See original GitHub issue

System information:

  • Operating system (distribution) and version: Microsoft Windows [Version 10.0.19042.1052]
  • DBeaver version: Version 21.1.1.202106210824

Connection specification:

  • Database name and version: H2 1.4.200
  • Driver name: org.h2.Driver

Describe the problem you’re observing:

The UI freezes for a short time when running a query.

Steps to reproduce, if exist:

Run this query:

select 
  cast((
    select coalesce(
      json_arrayagg(json_array("v0") order by "t"."v0"),
      json_array(null on null)
    )
    from (
      select 2 "v0"
      union
      select 4 "ID"
    ) "t"
  ) as text);

A profiling session shows that a lot of time is spent in DBeaver’s parser:

image

There’s a single hotspot:

image

Here’s a VisualVM snapshot with more details:

snapshot-1625731372916.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
n5a5commented, Jul 8, 2021

Hi Lukas. This looks like a performance issue in the @JSQLParser library. I’ll create a ticket on their issue tracker. Thanks for the report.

0reactions
uslsscommented, Sep 24, 2021

verified

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance - H2 Database Engine
For most operations, the performance of H2 is about the same as for HSQLDB. One situation where H2 is slow is large result...
Read more >
Improving Read/Write performance for 30 million records per ...
If query performance still seems slow, try running ANALYZE to update index statistics. *** Why I think the CSV reader may be slow:...
Read more >
Why can't H2 database parse a timestamp? - Stack Overflow
I can fix the error by setting up the string like TO_DATE('30-AUG-2018'), but changing the query kind of defeats the purpose since I...
Read more >
very weird slow query parse time, for very simple query
Hello, I'm running a very simple query on an Oracle 10.2.0.1.0 Express database from an imported schema: select * from table where pk_col ......
Read more >
Bug #4932: Error in reports after upgrade from H2 1.4.197 to ...
Parser.parse(Parser.java:843) [java] at org.h2.command. ... Issue #1097: H2 10x slower than HSQLDB and 6x than Apache Derby for specific query with GROUP BY ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found