Skip to content

Commit a408fb1

Browse files
mw5hfqazi
authored andcommitted
logic test: deflake distsql_stats
A recent change introduced by #150238 caused this test to sometimes choose a local plan distribution when using the 5node logic test configuration. This test is really more about the estimated row counts, so constrain the the EXPLAIN statements to just look at row count estimates instead of the entire plan. Fixes: #151839 Release note: None
1 parent 547553b commit a408fb1

File tree

1 file changed

+12
-66
lines changed

1 file changed

+12
-66
lines changed

pkg/sql/logictest/testdata/logic_test/distsql_stats

Lines changed: 12 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3411,76 +3411,36 @@ NULL {m} 1000 1000 true
34113411
NULL {n} 1000 50 true
34123412
NULL {o} 1000 33 true
34133413

3414+
# All we care about is the row counts, so don't error if other parts of the explain output change
34143415
query T retry
3415-
EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 9
3416+
SELECT info FROM [EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 9] WHERE info LIKE '%estimated row count:%'
34163417
----
3417-
distribution: full
3418-
vectorized: true
3419-
·
3420-
• render
3421-
3422-
└── • filter
34233418
│ estimated row count: 1
3424-
│ filter: n = 1
3425-
3426-
└── • scan
34273419
estimated row count: 18 (1.8% of the table; stats collected <hidden> ago)
3428-
table: mno@mno_o_idx
3429-
spans: [/9 - /9]
34303420

3421+
# All we care about is the row counts, so don't error if other parts of the explain output change
34313422
query T
3432-
EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 11
3423+
SELECT info FROM [EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 11] WHERE info LIKE '%estimated row count:%'
34333424
----
3434-
distribution: full
3435-
vectorized: true
3436-
·
3437-
• render
3438-
3439-
└── • filter
34403425
│ estimated row count: 1
3441-
│ filter: sqrt(m::FLOAT8)::INT8 = 11
3442-
3443-
└── • scan
34443426
estimated row count: 20 (2.0% of the table; stats collected <hidden> ago)
3445-
table: mno@mno_n_idx
3446-
spans: [/1 - /1]
34473427

34483428
statement ok
34493429
SET optimizer_use_virtual_computed_column_stats = false
34503430

3431+
# All we care about is the row counts, so don't error if other parts of the explain output change
34513432
query T
3452-
EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 9
3433+
SELECT info FROM [EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 9] WHERE info LIKE '%estimated row count:%'
34533434
----
3454-
distribution: full
3455-
vectorized: true
3456-
·
3457-
• render
3458-
3459-
└── • filter
34603435
│ estimated row count: 7
3461-
│ filter: n = 1
3462-
3463-
└── • scan
34643436
estimated row count: 10 (1.0% of the table; stats collected <hidden> ago)
3465-
table: mno@mno_o_idx
3466-
spans: [/9 - /9]
34673437

3438+
# All we care about is the row counts, so don't error if other parts of the explain output change
34683439
query T
3469-
EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 11
3440+
SELECT info FROM [EXPLAIN SELECT * FROM mno WHERE n = 1 AND o = 11] WHERE info LIKE '%estimated row count:%'
34703441
----
3471-
distribution: full
3472-
vectorized: true
3473-
·
3474-
• render
3475-
3476-
└── • filter
34773442
│ estimated row count: 7
3478-
│ filter: n = 1
3479-
3480-
└── • scan
34813443
estimated row count: 10 (1.0% of the table; stats collected <hidden> ago)
3482-
table: mno@mno_o_idx
3483-
spans: [/11 - /11]
34843444

34853445
# Regression for not setting the TypeResolver on the SemaContext when dealing
34863446
# with stats on virtual computed columns (#122312).
@@ -3577,39 +3537,25 @@ column_names row_count null_count distinct_count avg_size has_histogram
35773537
{b} 2 0 2 8 true
35783538
{c} 2 0 2 8 true
35793539

3540+
# All we care about is the row counts, so don't error if other parts of the explain output change
35803541
query T retry
3581-
EXPLAIN SELECT count(*) FROM t138809 WHERE b > 1
3542+
SELECT info FROM [EXPLAIN SELECT count(*) FROM t138809 WHERE b > 1] WHERE info LIKE '%estimated row count:%'
35823543
----
3583-
distribution: full
3584-
vectorized: true
3585-
·
3586-
• group (scalar)
35873544
│ estimated row count: 1
3588-
3589-
└── • scan
35903545
estimated row count: 2 (100% of the table; stats collected <hidden> ago)
3591-
table: t138809@t138809_pkey
3592-
spans: [/1 - ]
35933546

35943547
statement ok
35953548
SET CLUSTER SETTING jobs.debug.pausepoints = 'schemachanger.root..1'
35963549

35973550
statement error job \d+ was paused before it completed with reason: pause point "schemachanger\.root\.\.1" hit
35983551
ALTER TABLE t138809 DROP COLUMN c
35993552

3553+
# All we care about is the row counts, so don't error if other parts of the explain output change
36003554
query T
3601-
EXPLAIN SELECT count(*) FROM t138809 WHERE b > 1
3555+
SELECT info FROM [EXPLAIN SELECT count(*) FROM t138809 WHERE b > 1] WHERE info LIKE '%estimated row count:%'
36023556
----
3603-
distribution: full
3604-
vectorized: true
3605-
·
3606-
• group (scalar)
36073557
│ estimated row count: 1
3608-
3609-
└── • scan
36103558
estimated row count: 2 (100% of the table; stats collected <hidden> ago)
3611-
table: t138809@t138809_pkey
3612-
spans: [/1 - ]
36133559

36143560
statement ok
36153561
SET CLUSTER SETTING jobs.debug.pausepoints = DEFAULT

0 commit comments

Comments
 (0)