You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i test this also in latest snapshot of 2.5.1 series (Firebird-2.5.1.26375)
and plan is the same
and for my real query it looks like this
PLAN (KAT_TREE KK INDEX (FK_KAT_KAT__ID_KAT_MASTER)),
KO INDEX (FK_KAT_OBJ__ID_KAT), JOIN (ZS INDEX (FK_ZLEC_SERW__ID_OBJ, FK_ZLEC_SERW__ID_ZLEC_STAL), O INDEX (RDB$PRIMARY98))
), U INDEX (PK_UNISLOWNIK__ID)), UPAR INDEX (PK_UNISLOWNIK__ID))), ZSC INDEX (PK_ZLEC_SERW__ID)))
as you can see here are 9 opening parenthesis and 15 closing parenthesis..
Submitted by: @livius2
####################### metadata ###############################
CREATE TABLE TEST_TREE
(
ID INTEGER NOT NULL,
ID_HEADER INTEGER,
CONSTRAINT PK_TEST_TREE__ID PRIMARY KEY (ID)
);
CREATE INDEX IXA_TEST_TREE__ID_HEADER ON TEST_TREE (ID_HEADER);
####################### test data ###############################
INSERT INTO TEST_TREE (ID, ID_HEADER) VALUES ('1', NULL);
INSERT INTO TEST_TREE (ID, ID_HEADER) VALUES ('2', NULL);
INSERT INTO TEST_TREE (ID, ID_HEADER) VALUES ('3', NULL);
INSERT INTO TEST_TREE (ID, ID_HEADER) VALUES ('4', '1');
INSERT INTO TEST_TREE (ID, ID_HEADER) VALUES ('5', '4');
INSERT INTO TEST_TREE (ID, ID_HEADER) VALUES ('6', '2');
####################### test query ###############################
WITH RECURSIVE
R_TREE AS
(
SELECT http://TT.ID AS A, CAST(http://TT.ID AS VARCHAR(100)) AS ASUM
FROM TEST_TREE TT
WHERE TT.ID_HEADER IS NULL
UNION ALL
SELECT http://TT.ID AS A, RT.ASUM || '_' || http://TT.ID
FROM TEST_TREE TT JOIN R_TREE RT ON RT.A = TT.ID_HEADER
)
SELECT
*
FROM
R_TREE RT2 INNER JOIN TEST_TREE TT2 ON TT2.ID=RT2.A
####################### plan returned b y engine ###############################
PLAN JOIN ((R_TREE TT INDEX (IXA_TEST_TREE__ID_HEADER))
PLAN (R_TREE TT INDEX (IXA_TEST_TREE__ID_HEADER)), TT2 INDEX (PK_TEST_TREE__ID))
as you can see count of opening parenthesis are not equal to count of closing parenthesis
The text was updated successfully, but these errors were encountered: