risingwavelabs / risingwave

Best-in-class stream processing, analytics, and management. Perform continuous analytics, or build event-driven applications, real-time ETL pipelines, and feature stores in minutes. Unified streaming and batch. PostgreSQL compatible.
https://go.risingwave.com/slack
Apache License 2.0
6.87k stars 569 forks source link

Tracking: Nexmark queries optimization #7289

Open lmatz opened 1 year ago

lmatz commented 1 year ago

Validation:

  1. Compare the executable plan of RW and other systems. Make sure we are running the same/similar plan(unless it is some non-trivial plan-level optimization).
  2. Make sure when benchmarking, the test is executed with a unified nexmark source instead of 3 separate sources, details in https://github.com/risingwavelabs/risingwave/issues/6747. In short, otherwise join will miss much more than normal and it leads to an ill-structured workload.
  3. Also make sure that the query uses create sink XXX with ( connector = 'blackhole' ) instead of create materialized view as the other system doesn't have a materialized view. Although some plans shown in the sub-issues are still in the form of materialized view.

Optimization Tasks

Watermark

We notice that at https://github.com/nexmark/nexmark/blob/master/nexmark-flink/src/main/resources/queries/ddl_gen.sql#L37, Nexmark's source table has specified watermark as FOR dateTime AS dateTime - INTERVAL '4' SECOND. As watermark helps clean the state table and thus potentially improve the performance of state access, we also track the progress of watermark here:

The queries

Queries made up by @BugenZhao to cover stream operators that are not covered by the standard Nexmark:

lmatz commented 1 year ago

q15, q16, q17 have similar query patterns, and they may suffer from the same problem. SCR-20230313-n1d

lmatz commented 1 year ago

Q6 requires AVG over. Flink would output error when running this query. Q11 requires session_start. Q12 requires proc_time. Q13 requires proc_time. Q14 requires count_char UDF.

By 4/4, Q19 is supported but not enabled on the performance dashboard.