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
Derived table and normal table plan issue - some indexes can not by used [CORE2327] #2751
Comments
Modified by: @livius2description: Some indexes can not be used i we select from derived table normal table select: (SELECT but when i use derived table this plan is not acceptable but should be SELECT (SELECT in second query with derived table i get this error: Engine Code : 335544642 => Some indexes can not be used i we select from derived table //this is only sample then not look for logic in this query normal table select: (SELECT but when i use derived table this plan is not acceptable but should be SELECT (SELECT in second query with derived table i get this error: Engine Code : 335544642 |
Commented by: @dyemanov Does this issue exist in v2.1.2 RC1 as well? |
Modified by: @livius2description: Some indexes can not be used i we select from derived table //this is only sample then not look for logic in this query normal table select: (SELECT but when i use derived table this plan is not acceptable but should be SELECT (SELECT in second query with derived table i get this error: Engine Code : 335544642 => Some indexes can not be used i we select from derived table //this is only sample then not look for logic in this query normal table select: but when i use derived table this plan is not acceptable but should be SELECT in second query with derived table i get this error: Engine Code : 335544642 |
Commented by: @livius2 I try this now in v2.1.2 RC1 and also the same problem |
Commented by: @dyemanov As far as I understand, this ticket duplicates CORE1607 which is fixed in v2.5 Beta and post-v2.1.2 builds. |
Modified by: @livius2description: Some indexes can not be used i we select from derived table //this is only sample then not look for logic in this query normal table select: but when i use derived table this plan is not acceptable but should be SELECT in second query with derived table i get this error: Engine Code : 335544642 => Some indexes can not be used i we select from derived table //this is only sample then not look for logic in this query normal table select: but when i use derived table this plan is not acceptable but should be SELECT in second query with derived table i get this error: Engine Code : 335544642 |
Commented by: @livius2 I see that this is becaouse of union SELECT i will test it on snapshot tomorrow |
Commented by: @livius2 with FB2.5 Alpha 1 doesn't work but as you say i test it |
Modified by: @livius2Version: 2.5 Alpha 1 [ 10224 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Submitted by: @livius2
Duplicates CORE1607
Some indexes can not be used i we select from derived table
but is posible to use it in plan if it is a normal table
//this is only sample then not look for logic in this query
normal table select:
SELECT
(SELECT
FIRST 1 http://G.ID
FROM
GPRSTEST_DB G
WHERE
G.OBIEKT=A.OBIEKT
AND G.DATAP<= '2009-02-17'
AND G.DATAP+G.CZASP<= '2009-02-17 12:00'
PLAN (G ORDER IXD_GPRSTEST_DB__DATAP__CZASP INDEX (IXA_GPRSTEST_DB__OBIEKT))
ORDER BY G.DATAP DESC, G.CZASP DESC
)
FROM
ADRESY_DB A
but when i use derived table this plan is not acceptable but should be
SELECT
(SELECT
FIRST 1 http://G.ID
FROM
GPRSTEST_DB G
WHERE
G.OBIEKT=A.OBIEKT
AND G.DATAP<= '2009-02-17'
AND G.DATAP+G.CZASP<= '2009-02-17 12:00'
PLAN (G ORDER IXD_GPRSTEST_DB__DATAP__CZASP INDEX (IXA_GPRSTEST_DB__OBIEKT))
ORDER BY G.DATAP DESC, G.CZASP DESC
)
FROM
(
SELECT 'X001' AS OBIEKT FROM RDB$DATABASE A
union
SELECT 'X002' AS OBIEKT FROM RDB$DATABASE A
union
SELECT 'X003' AS OBIEKT FROM RDB$DATABASE A
union
SELECT 'X004' AS OBIEKT FROM RDB$DATABASE A
union
SELECT 'X005' AS OBIEKT FROM RDB$DATABASE A
) AS A(OBIEKT)
in second query with derived table i get this error:
SQL Message : -284
index cannot be used in the specified plan
Engine Code : 335544642
Engine Message :
index IXA_GPRSTEST_DB__OBIEKT cannot be used in the specified plan
The text was updated successfully, but these errors were encountered: