✕

Join us for a virtual meetup on Zoom at 8 PM, July 31 (PDT) about using One Time Series Database for Both Metrics and Logs 👉🏻 Register Now

✕
Skip to content
On this page
Biweekly
•
August 20, 2025

TQL CTE Support, PromQL Compatibility Enhancements, and Remote WAL Trimming Optimization | Greptime Biweekly Report

Recent progress in GreptimeDB over the past two weeks - more flexible querying, improved PromQL expression compatibility, and other feature enhancements.

Summary ​

Together with our global community of contributors, GreptimeDB continues to evolve and flourish as a growing open-source project. We are grateful to each and every one of you.

Below are the highlights among recent commits:

  • Introduced CTE in TQL, allowing hybrid usage with SQL CTEs for more flexible queries.
  • Added mysql.prepared_stmt_cache_size configuration to control the number of cached prepared statements.
  • Aligned the behavior of label_join and label_replace with Prometheus, improving PromQL expression compatibility.
  • Implemented last-not-null and last-row deduplicate strategies for the Flat Parquet format.

Contributors ​

For the past two weeks, our community has been super active with a total of 116 PRs merged. 6 PRs from 3 individual contributors merged successfully and lots pending to be merged.

Congrats on becoming our most active contributors in the past 2 weeks:

👏 Welcome @kemingy to the community as a new contributor with a successfully merged PR, and more PRs from other individual contributors are waiting to be merged.

(Figure 1: New Contributor of GreptimeDB)
(Figure 1: New Contributor of GreptimeDB)

👏 A big THANK YOU to all our members and contributors! It is people like you who are making GreptimeDB a great product. Let's build an even greater community together.

Highlights of Recent PRs ​

db#6639 Added mysql.prepared_stmt_cache_size Configuration ​

Introduced a new configuration to control the number of cached MySQL prepared statements. The default value is 10000.

db#6645 TQL Support for CTE (Common Table Expression) ​

Added CTE support for TQL, allowing hybrid usage with SQL CTEs. For example, you can first query data using TQL and then filter it via SQL subqueries for more flexible query combinations.

sql
-- TQL CTE with column aliases
WITH tql (the_timestamp, the_value) as (
    TQL EVAL (0, 40, '10s') metric
)
SELECT * FROM tql;

+---------------------+-----------+
| the_timestamp       | the_value |
+---------------------+-----------+
| 1970-01-01T00:00:00 | 0.0       |
| 1970-01-01T00:00:10 | 8.0       |
| 1970-01-01T00:00:20 | 8.0       |
| 1970-01-01T00:00:30 | 2.0       |
| 1970-01-01T00:00:40 | 3.0       |
+---------------------+-----------+

-- Hybrid CTEs (TQL + SQL)
WITH 
    tql_data (ts, val) AS (TQL EVAL (0, 40, '10s') metric),
    filtered AS (SELECT * FROM tql_data WHERE val > 5)
SELECT count(*) FROM filtered;

+----------+
| count(*) |
+----------+
| 2        |
+----------+

db#6714 db#6720 Improved PromQL Expression Compatibility ​

Fixed label_join and label_replace behaviors to align with Prometheus, enhancing PromQL expression compatibility.

db#6691 Added SQL Formatting HTTP Endpoint ​

Introduced the /v1/sql/format endpoint for SQL formatting.

Example:

bash
curl -s "http://localhost:4000/v1/sql/format?sql=select%201%20as%20x"

Output:

bash
{
  "formatted": "SELECT 1 AS x;"
}

db#6741 Optimized Remote WAL Pruning Strategy ​

Used estimated data size from statistics to prune WAL, ensuring that Datanode startup does not replay excessive data even in worst-case scenarios.

db#6709 db#6695 Deduplication Strategies for Flat Parquet Format ​

Added support for last-not-null and last-row deduplication strategies.

Good First Issue ​

Issue#6287 Allows users to specify date and timestamp formats when using COPY TO ​

Keywords: Timestamp format

Difficulty: Simple

Issue#6286 Supports exporting compressed CSV or JSON files ​

Keywords: Data export

Difficulty: Simple

Issue #6334 Enhances KILL support for INSERT INTO SELECT queries ​

Keywords: Query engine

Difficulty: Medium

Join our community

Get the latest updates and discuss with other users.