TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

count(*) performance tuning

Open wuyongx opened this issue 2 years ago • 3 comments

Performance Issue Any questions related to TDengine's performance can be discussed here.

Problem Description A clear and concise description of what the problem is.

To Reproduce Steps to reproduce the behavior:

  1. Database parameters used: Database: CREATE DATABASE `front_end_metric_31` BUFFER 96 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 3 STRICT 'off' WAL_LEVEL 2 VGROUPS 2 SINGLE_STABLE 0
  2. Verbs used: Select? select count(*) from front_end_metric_31.stb_visit_log;
       count(*)        |
========================
               4290299 |
Query OK, 1 rows in database (40.150812s)
  1. Describe the total amount of data 4 million
  2. Observed performance vs. expected performance blow 10s Screenshots If applicable, add screenshots to help explain your problem. image image

Environment (please complete the following information):

OS: [Red Hat Enterprise Linux Server release 7.6 ] Memory, CPU, current Disk Space :8C 24G ,500G TDengine Version [3.0.1.0]

wuyongx avatar Oct 08 '22 06:10 wuyongx

可以先换到 3.0.1.4 ,这块做了一些重构

yu285 avatar Oct 09 '22 02:10 yu285

发的什么东西,你电话多少?

苏佳音

@.***

电子名片新出VIP模板啦,快来体验>>

扫一扫,

快速添加名片到手机


------------------ 原始邮件 ------------------

发件人: Qiuzhuang Lian @.***>

发送时间: 2022-11-28 01:30:12

收件人:taosdata/TDengine @.***>

抄送:Subscribed @.***>

主题: Re: [taosdata/TDengine] count(*) performance tuning (Issue #17210)

可以先换到 3.0.1.4 ,这块做了一些重构

如果对表数据进行频繁的更新,结果会导致count 越来越慢。

貌似3.X 更新了update 这部分 - 采用这种机制,删除功能对于写操作变得相对简单了,但是对于查询而言,则变得更加复杂了。查询在合并数据时,要判断记录是不是被删除了,即检查记录是不是在所有的删除区间(矩形)里面,这是相当耗时的。

麻烦帮忙确认下,谢谢。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

13917781779 avatar Nov 28 '22 12:11 13917781779