Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with CASE and nested functions results in very long execution #2852

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed
Labels
bug Something isn't working major SQL

Comments

@monetdb-team
Copy link

Date: 2011-08-07 17:06:11 +0200
From: Alfred Nordman <<alfred.nordman>>
To: SQL devs <>
Version: 11.3.7 (Apr2011-SP2) [obsolete]
CC: @njnes, @drstmane

Last updated: 2011-09-16 15:04:37 +0200

Comment 16087

Date: 2011-08-07 17:06:11 +0200
From: Alfred Nordman <<alfred.nordman>>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1
Build Identifier:

SQL statement with case division and embedded functions compiles about 2 minutes on my computer. If I change "/" to "*" everything is executed immediately.

Reproducible: Always

Steps to Reproduce:

1.CREATE TABLE t (c INT);
2.INSERT INTO t VALUES (0);
3.explain SELECT
COALESCE(
COALESCE("c" /
CASE
WHEN COALESCE("c" , 0) = 0
THEN
NULL
END
, 0) - COALESCE("c" /
CASE
WHEN "c" = 0
THEN
NULL
END
,0)
, 0)
FROM
t
;

Actual Results:

Very long compilation time. It looks like generated MAL code is not correct

Expected Results:

I guess that this script must be compiled immediately

I managed to simplify my initial script which hanged the computer to this test case. Further simplifications lead to immediate execution.
The result of this script does not have any sense it is only test sample

Comment 16113

Date: 2011-08-19 16:29:20 +0200
From: @njnes

fixed. The long execution time was caused by recusive inplace modifing the relational tree

Comment 16128

Date: 2011-08-22 08:17:06 +0200
From: @drstmane

We should consider adding a test (also) for this one.

Comment 16135

Date: 2011-08-22 16:41:13 +0200
From: @drstmane

Changeset fa813932a753 made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=fa813932a753

Changeset description:

added tests for bug #2852 & bug #2862

Comment 16247

Date: 2011-09-16 15:04:37 +0200
From: @sjoerdmullender

The Aug2011 version has been released.

@monetdb-team monetdb-team added bug Something isn't working major SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major SQL
Projects
None yet
Development

No branches or pull requests

2 participants