Open RaduBerinde opened 4 years ago
This TODO is relevant: https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/parser/sql.y#L8139
This bug resulted in nasty relational subquery nesting the optimizer turned into 9 joins, of which 7 are just in a diagonal line in the explain
output. And those all are encased in two layers of explicitly-sorting group-by aggregations.
Highly denormalized tables using the left join
+coalesce
attribute inheritance pattern cause enough query complexity on their own. Things like not having this bug are what we have to stay afloat among these confusing factors.
The workaround we suggested offline, along the lines of select json_agg(distinct j) from (select * from a order by j)
doesn't require changing the input of the query (a
).
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
Jira issue: CRDB-5288