Result mismatch for a complex SQL in MySQL 8.0.32
Posted by:
Forrest Dai
Date: September 17, 2024 03:45AM
Hi experts,
I get a mistach result from a complex query, which the rows is lost.
From the trace analyze report I can see the row is lost during Filesort on rowid:
-> Sort row IDs: asn_header_id DESC (cost=631.89 rows=526) (actual time=11.843..11.843 rows=0 loops=1)
-> Filter: ((gsp_prd_view.dst__1.tenant_id = 10191) and <in_optimizer>(gsp_prd_view.dst__1.attribute_bigint4,<exists>(select #6))) (cost=631.89 rows=526) (actual time=0.088..11.597 rows=526 loops=1)
-> Index range scan on DST__1 using sinv_asn_header_n5 over ('2024-07-01 15:00:00' <= attribute_datetime1 <= '2024-07-31 14:59:59'), with index condition: (((gsp_prd_view.dst__1.attribute_datetime1 >= TIMESTAMP'2024-07-01 15:00:00') and (gsp_prd_view.dst__1.attribute_datetime1 <= TIMESTAMP'2024-07-31 14:59:59')) and (gsp_prd_view.dst__1.asn_header_id is not null)) (cost=631.89 rows=526) (actual time=0.068..6.709 rows=526 loops=1)
-> Select #6 (subquery in condition; dependent)
-> Limit: 1 row(s) (cost=1.10 rows=1) (actual time=0.006..0.007 rows=1 loops=526)
-> Single-row covering index lookup on hual1 using hiam_user_authority_line_u1 (authority_id='13630', data_id=<cache>(gsp_prd_view.dst__1.attribute_bigint4)) (cost=1.10 rows=1) (actual time=0.006..0.006 rows=1 loops=526)
I cannot figure out the reason, I suspect if it is a defect.
Any comments and suggession is appericate.
Thank you
Subject
Written By
Posted
Result mismatch for a complex SQL in MySQL 8.0.32
September 17, 2024 03:45AM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.