Giter VIP home page Giter VIP logo

Comments (2)

yuzefovich avatar yuzefovich commented on August 16, 2024

I reduced this so far to:

SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;

CREATE TABLE table1 (col1_2 INT, col1_5 BYTES, col1_6 FLOAT4);

CREATE TABLE table3 (col3_0 INT);

ALTER TABLE table1 INJECT STATISTICS '[{"avg_size": 21, "columns": ["col1_5"], "created_at": "2000-01-01 00:00:00+00:00", "distinct_count": 4355941221932217744, "histo_col_type": "", "name": "__auto__", "null_count": 1441974855537419809, "row_count": 4360275294930779434}]';

INSERT INTO table1 (col1_6, col1_5, col1_2) VALUES (0, '1', 1);
INSERT INTO table1 (col1_6, col1_5, col1_2) VALUES (0, '', 2);
INSERT INTO table3 (col3_0) VALUES (1);

SET testing_optimizer_random_seed = 8309711156756112119;
SET testing_optimizer_disable_rule_probability = 0.500000;

SET vectorize = off;

SELECT
	string_agg(tab_1893.col1_5::BYTES, tab_1893.col1_5::BYTES ORDER BY tab_1893.col1_5::BYTES ASC NULLS LAST)::BYTES
		AS col_5396,
	tab_1893.col1_6 AS col_5398
FROM
	defaultdb.public.table1 AS tab_1893
WHERE
	EXISTS(
		SELECT
			true AS col_5394
		FROM
			defaultdb.public.table3 AS tab_1897
	)
GROUP BY
	tab_1893.col1_6, tab_1893.col1_5
HAVING
	bool_and(true::BOOL)::BOOL
ORDER BY
	col_5398 DESC NULLS LAST,
	tab_1893.col1_6 ASC NULLS FIRST,
	col_5396 ASC NULLS FIRST,
	tab_1893.col1_5 ASC NULLS FIRST
LIMIT
	3;

RESET testing_optimizer_random_seed;
RESET testing_optimizer_disable_rule_probability;

SELECT
	string_agg(tab_1893.col1_5::BYTES, tab_1893.col1_5::BYTES ORDER BY tab_1893.col1_5::BYTES ASC NULLS LAST)::BYTES
		AS col_5396,
	tab_1893.col1_6 AS col_5398
FROM
	defaultdb.public.table1 AS tab_1893
WHERE
	EXISTS(
		SELECT
			true AS col_5394
		FROM
			defaultdb.public.table3 AS tab_1897
	)
GROUP BY
	tab_1893.col1_6, tab_1893.col1_5
HAVING
	bool_and(true::BOOL)::BOOL
ORDER BY
	col_5398 DESC NULLS LAST,
	tab_1893.col1_6 ASC NULLS FIRST,
	col_5396 ASC NULLS FIRST,
	tab_1893.col1_5 ASC NULLS FIRST
LIMIT
	3;

The bug is only reproducible on 23.1 (23.2+ we hit an error that we can't decorrelate the subquery) and appears to only affect the row-by-row engine, so I'm removing the release blocker label.

from cockroach.

yuzefovich avatar yuzefovich commented on August 16, 2024

Ah, this is a dup of #124101. I'll backport one of the commits from this fix that should be non-contentions since debugging this problem is non-trivial.

from cockroach.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.