wenzhenghu opened a new issue, #59137:
URL: https://github.com/apache/doris/issues/59137

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   all versions
   
   ### What's Wrong?
   
   The SqlDigestfield in the audit log for slow queries is always 
d41d8cd98f00b204e9800998ecf8427e(null string), regardless of the stmt content
   
   We can obtain direct evidence from the audit log documentation of Doris 
https://doris.apache.org/docs/4.x/query-acceleration/performance-tuning-overview/diagnostic-tools#audit-log.
 
   ```
   2024-07-18 11:23:13,042 [slow_query] 
|Client=127.0.0.1:63510|User=root|Ctl=internal|Db=tpch_sf1000|State=EOF|ErrorCode=0|ErrorMessage=|Time(ms)=11603|ScanBytes=236667379712|ScanRows=13649979418|ReturnRows=100|StmtId=1689|QueryId=91ff336304f14182-9ca537eee75b3856|IsQuery=true|isNereids=true|feIp=172.21.0.10|Stmt=select
     c_name,     c_custkey,     o_orderkey,     o_orderdate,     o_totalprice,  
   sum(l_quantity) from     customer,     orders,     lineitem where     
o_orderkey  in  (         select             l_orderkey         from            
 lineitem         group  by             l_orderkey  having                 
sum(l_quantity)  >  300     )     and  c_custkey  =  o_custkey     and  
o_orderkey  =  l_orderkey group  by     c_name,     c_custkey,     o_orderkey,  
   o_orderdate,     o_totalprice order  by     o_totalprice  desc,     
o_orderdate limit  
100|CpuTimeMS=918556|ShuffleSendBytes=3267419|ShuffleSendRows=89668|SqlHash=b4e1de9f251214a30188180f37907f7d|peakMemoryBytes=3
 
8720935552|SqlDigest=d41d8cd98f00b204e9800998ecf8427e|cloudClusterName=UNKNOWN|TraceId=|WorkloadGroup=normal|FuzzyVariables=|scanBytesFromLocalStorage=0|scanBytesFromRemoteStorage=0
   2024-07-18 11:23:33,043 [slow_query] 
|Client=127.0.0.1:26672|User=root|Ctl=internal|Db=tpch_sf1000|State=EOF|ErrorCode=0|ErrorMessage=|Time(ms)=8978|ScanBytes=334985555968|ScanRows=10717654374|ReturnRows=100|StmtId=1815|QueryId=6e1fae453cb04d9a-b1e5f94d9cea1885|IsQuery=true|isNereids=true|feIp=172.21.0.10|Stmt=select
     s_name,     count(*) as numwait from     supplier,     lineitem l1,     
orders,     nation where     s_suppkey = l1.l_suppkey     and o_orderkey = 
l1.l_orderkey     and o_orderstatus = 'F'     and l1.l_receiptdate > 
l1.l_commitdate     and exists (         select             *         from      
       lineitem l2         where                 l2.l_orderkey = l1.l_orderkey  
         and l2.l_suppkey <> l1.l_suppkey     )     and not exists (         
select             *         from             lineitem l3         where         
        l3.l_orderkey = l1.l_orderkey           and l3.l_suppkey <> 
l1.l_suppkey           and l3.l_receiptdate > l3.l_commitdate     )    
  and s_nationkey = n_nationkey     and n_name = 'SAUDI ARABIA' group by     
s_name order by     numwait desc,     s_name limit 
100|CpuTimeMS=990127|ShuffleSendBytes=59208164|ShuffleSendRows=3651504|SqlHash=f8a30e4182d72cce3eff6cb385005b1f|peakMemoryBytes=10495660672|SqlDigest=d41d8cd98f00b204e9800998ecf8427e|cloudClusterName=UNKNOWN|TraceId=|WorkloadGroup=normal|FuzzyVariables=|scanBytesFromLocalStorage=0|scanBytesFromRemoteStorage=0
   2024-07-18 11:23:41,044 [slow_query] 
|Client=127.0.0.1:26684|User=root|Ctl=internal|Db=tpch_sf1000|State=EOF|ErrorCode=0|ErrorMessage=|Time(ms)=8514|ScanBytes=334986551296|ScanRows=10717654374|ReturnRows=100|StmtId=1833|QueryId=4f91483464ce4aa8-beeed7dcb8675bc8|IsQuery=true|isNereids=true|feIp=172.21.0.10|Stmt=select
     s_name,     count(*) as numwait from     supplier,     lineitem l1,     
orders,     nation where     s_suppkey = l1.l_suppkey     and o_orderkey = 
l1.l_orderkey     and o_orderstatus = 'F'     and l1.l_receiptdate > 
l1.l_commitdate     and exists (         select             *         from      
       lineitem l2         where                 l2.l_orderkey = l1.l_orderkey  
         and l2.l_suppkey <> l1.l_suppkey     )     and not exists (         
select             *         from             lineitem l3         where         
        l3.l_orderkey = l1.l_orderkey           and l3.l_suppkey <> 
l1.l_suppkey           and l3.l_receiptdate > l3.l_commitdate     )    
  and s_nationkey = n_nationkey     and n_name = 'SAUDI ARABIA' group by     
s_name order by     numwait desc,     s_name limit 
100|CpuTimeMS=925841|ShuffleSendBytes=59223190|ShuffleSendRows=3651602|SqlHash=f8a30e4182d72cce3eff6cb385005b1f|peakMemoryBytes=10505123104|SqlDigest=d41d8cd98f00b204e9800998ecf8427e|cloudClusterName=UNKNOWN|TraceId=|WorkloadGroup=normal|FuzzyVariables=|scanBytesFromLocalStorage=0|scanBytesFromRemoteStorage=0
   2024-07-18 11:23:49,044 [slow_query] 
|Client=127.0.0.1:10748|User=root|Ctl=internal|Db=tpch_sf1000|State=EOF|ErrorCode=0|ErrorMessage=|Time(ms)=8660|ScanBytes=334987673600|ScanRows=10717654374|ReturnRows=100|StmtId=1851|QueryId=4599cb1bab204f80-ac430dd78b45e3da|IsQuery=true|isNereids=true|feIp=172.21.0.10|Stmt=select
     s_name,     count(*) as numwait from     supplier,     lineitem l1,     
orders,     nation where     s_suppkey = l1.l_suppkey     and o_orderkey = 
l1.l_orderkey     and o_orderstatus = 'F'     and l1.l_receiptdate > 
l1.l_commitdate     and exists (         select             *         from      
       lineitem l2         where                 l2.l_orderkey = l1.l_orderkey  
         and l2.l_suppkey <> l1.l_suppkey     )     and not exists (         
select             *         from             lineitem l3         where         
        l3.l_orderkey = l1.l_orderkey           and l3.l_suppkey <> 
l1.l_suppkey           and l3.l_receiptdate > l3.l_commitdate     )    
  and s_nationkey = n_nationkey     and n_name = 'SAUDI ARABIA' group by     
s_name order by     numwait desc,     s_name limit 
100|CpuTimeMS=932664|ShuffleSendBytes=59223178|ShuffleSendRows=3651991|SqlHash=f8a30e4182d72cce3eff6cb385005b1f|peakMemoryBytes=10532849344|SqlDigest=d41d8cd98f00b204e9800998ecf8427e|cloudClusterName=UNKNOWN|TraceId=|WorkloadGroup=normal|FuzzyVariables=|scanBytesFromLocalStorage=0|scanBytesFromRemoteStorage=0
   ```
   The example contains four slow query log entries, generated by two different 
SQL patterns(1 and 2,3,4), yet the SqlDigestfield for all of them is 
d41d8cd98f00b204e9800998ecf8427e
   
   
   ### What You Expected?
   
   should be SQL pattern md5 rather than null string md5
   
   ### How to Reproduce?
   
   just config.qe_slow_log_ms small enough
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to