Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Feature: Materialized CTE

Open
#4,246 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, sql
Domain
databases

Research direction

Start by tracing H2's recursive CTE handling and its behavior when a CTE is referenced from subqueries. Compare the requested PostgreSQL-style MATERIALIZED syntax and semantics; done means the syntax is accepted and recursive results are materialized for subsequent references without requiring a separate update operation.

Written by the indexing model from the issue text.

Description

enhancement WITH clause

In context of recursive CTEs I've noticed a significant performance impact when addressing CTE in subqueries.
My assumption is, as soon as recursive CTE is queried the whole recursion is triggered from the very beginning.
The simple solution could be to materialize the result of recursion in TEMP TABLE or MATERIALIZED VIEW. However it is a separate update operation. What would be really nice to have a materialized CTE, similar to what Postgres supports: WITH MY_CTE AS MATERIALIZED (SELECT * FROM SOURCE) SELECT * FROM MY_CTE

Dominant language
Java
Stars
4.6k
Forks
1.3k
Avg merge
1d 8h
Merged PRs (30d)
33

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from h2database/h2database

All issues in h2database/h2database

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.