When the same SQL statement is executed concurrently 50 times, the NIC receive (RECV) bandwidth is saturated.

Open
#20,801 5 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@zhang2014 is already working on this.

Since Oct 23, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
aws, rust, sql

Research direction

Start by reproducing the reported query with 50 concurrent executions on Databend Query v1.2.926-nightly, then inspect the query execution and cache metrics to identify what drives RECV bandwidth. The issue does not name relevant source files or tests, so trace the TableScan and RowFetch path and check existing cache tests. Done means explaining whether data is fetched from S3 on each run and why the cache is or is not used.

Written by the indexing model from the issue text.

Description

Summary

Image system: Databend Query v1.2.926-nightly Ubuntu 24.04.2 LTS explain: root@localhost:8000/default/finance_analytics> explain SELECT id,owner_id,owner_type,owner_uuid,product_code,charge_type,territory_id,area_code,country_code,region_code,zone_code,product_item_name,metering_mode,product_config_item,product_item_unit,metered_value,duration_value,duration_unit,resource_uuid,resource_name,bill_type,payment_status,bill_amount,discount_amount,create_time FROM bill WHERE NOT (charge_type = 'POSTPAID' AND bill_type IN ('PURCHASE', 'CHANGE_SPEC', 'UNSUBSCRIBE')) AND owner_id = 2043589318811717632 AND owner_type = 'ORGANIZATION' AND bill_period = '2026-10' ORDER BY create_time DESC, id DESC LIMIT 20;

-[ EXPLAIN ]-----------------------------------
RowFetch
├── output columns: [bill.id (#0), bill.owner_id (#1), bill.owner_type (#2), bill.charge_type (#15), bill.bill_type (#17), bill.create_time (#34), bill._row_id (#37), bill.owner_uuid (#3), bill.product_code (#5), bill.territory_id (#6), bill.area_code (#7), bill.country_code (#8), bill.region_code (#9), bill.zone_code (#10), bill.product_item_name (#12), bill.resource_uuid (#13), bill.resource_name (#14), bill.metering_mode (#16), bill.payment_status (#18), bill.product_config_item (#19), bill.metered_value (#20), bill.duration_value (#21), bill.duration_unit (#22), bill.product_item_unit (#26), bill.discount_amount (#27), bill.bill_amount (#28)]
├── columns to fetch: [owner_uuid, product_code, territory_id, area_code, country_code, region_code, zone_code, product_item_name, resource_uuid, resource_name, metering_mode, payment_status, product_config_item, metered_value, duration_value, duration_unit, product_item_unit, discount_amount, bill_amount]
├── estimated rows: 20.00
└── Limit
├── output columns: [bill.id (#0), bill.owner_id (#1), bill.owner_type (#2), bill.charge_type (#15), bill.bill_type (#17), bill.create_time (#34), bill._row_id (#37)]
├── limit: 20
├── offset: 0
├── estimated rows: 20.00
└── Sort(Single)
├── output columns: [bill.id (#0), bill.owner_id (#1), bill.owner_type (#2), bill.charge_type (#15), bill.bill_type (#17), bill.create_time (#34), bill._row_id (#37)]
├── sort keys: [create_time DESC NULLS LAST, id DESC NULLS LAST]
├── estimated rows: 77147.06
└── TableScan
├── table: default.finance_analytics.bill
├── scan id: 0
├── output columns: [id (#0), owner_id (#1), owner_type (#2), charge_type (#15), bill_type (#17), create_time (#34), _row_id (#37)]
├── read rows: 210048
├── read size: 1.71 MiB
├── partitions total: 19
├── partitions scanned: 1
├── pruning stats: [segments: <read cost: 1 ms, decompress cost: 4 ms, range pruning: 19 to 14 cost: 2 ms>, blocks: <range pruning: 21 to 15 cost: 3 ms, bloom index read cost: 2 ms, bloom pruning: 15 to 1 cost: 3 ms>]
├── push downs: [filters: [bill.owner_id (#1) = 2043589318811717632 and NOT (bill.charge_type (#15) = 'POSTPAID' AND ((bill.bill_type (#17) = 'PURCHASE' OR bill.bill_type (#17) = 'CHANGE_SPEC') OR bill.bill_type (#17) = 'UNSUBSCRIBE')) and bill.owner_type (#2) = 'ORGANIZATION' and bill.bill_period (#4) = '2026-10'], limit: 20]
└── estimated rows: 77147.06

24 rows explain in 0.109 sec. Processed 0 rows, 0 B (0 row/s, 0 B/s)

why:
Is the RECV bandwidth generated by pulling data from S3? Why is the cache not being used, and why does it need to pull data from S3 every time?
目标并发度 : 50
实际峰值并发 : 50
平均并发 : 49.89
总执行次数 : 10982 (成功 10982 / 失败 0)
总耗时 : 180.698 s
平均 QPS : 60.78 成功/s (总尝试 60.78 /s)
峰值 QPS : 81.0 /s (单秒最高,* 号为不足 1 秒的窗口)

单查询延迟 (ms)
avg 820.82 min 349.74 max 3936.64
p50 790.07 p90 1067.89 p95 1157.65 p99 1402.89

Dominant language
Rust
Stars
9.5k
Forks
903
Avg merge
2d 13h
Merged PRs (30d)
204

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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 databendlabs/databend

All issues in databendlabs/databend

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.