[ 
https://issues.apache.org/jira/browse/IGNITE-26404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksandr Chesnokov updated IGNITE-26404:
-----------------------------------------
    Description: 
{{H2QueryInfo#planWithoutScanCount}} does not consider all cases:

1) It deletes only the first occurrence of the {{scanCount}} field, but there 
can be several occurrences (e.g. in {{{}UNION{}}})

2) Sometimes {{scanCount}} is located inside {{/++ ... ++/}} comments, not in 
{{/* ... */}}

As a result, it generates local plans for perfStat that differ only by 
{{{}scanCount{}}}, which makes {{perfStat}} heavier

An example is given below.

Before:

 
{noformat}
SELECT 
    u.id, 
    u.name 
FROM users u 
WHERE u.active = true
/* scanCount: 1 */
UNION ALL
SELECT 
    c.id, 
    c.contact_name 
FROM customers c 
WHERE c.status = 'VIP';
/* scanCount: 3 */
{noformat}
After:
{noformat}
SELECT  
    u.id, 
    u.name 
FROM users u 
WHERE u.active = true
UNION ALL
SELECT  
    c.id, 
    c.contact_name 
FROM customers c 
WHERE c.status = 'VIP'

ORDER BY name;


{noformat}
 

  was:
{{H2QueryInfo#planWithoutScanCount}} does not consider all cases:

1) It deletes only the first occurrence of the {{scanCount}} field, but there 
can be several occurrences (e.g. in {{{}UNION{}}})

2) Sometimes {{scanCount}} is located inside {{/++ ... ++/}} comments, not in 
{{/* ... */}}

As a result, it generates local plans for perfStat that differ only by 
{{{}scanCount{}}}, which makes {{perfStat}} heavier

An example is given below.

Before:

 
{noformat}
SELECT /* scanCount: 1 */ 
    u.id, 
    u.name 
FROM users u 
WHERE u.active = true
UNION ALL
SELECT /* scanCount: 3 */ 
    c.id, 
    c.contact_name 
FROM customers c 
WHERE c.status = 'VIP'

ORDER BY name;
{noformat}
After:
{noformat}
SELECT  
    u.id, 
    u.name 
FROM users u 
WHERE u.active = true
UNION ALL
SELECT  
    c.id, 
    c.contact_name 
FROM customers c 
WHERE c.status = 'VIP'

ORDER BY name;


{noformat}
 


> H2QueryInfo#planWithoutScanCount does not consider all cases
> ------------------------------------------------------------
>
>                 Key: IGNITE-26404
>                 URL: https://issues.apache.org/jira/browse/IGNITE-26404
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksandr Chesnokov
>            Assignee: Aleksandr Chesnokov
>            Priority: Major
>              Labels: ise
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {{H2QueryInfo#planWithoutScanCount}} does not consider all cases:
> 1) It deletes only the first occurrence of the {{scanCount}} field, but there 
> can be several occurrences (e.g. in {{{}UNION{}}})
> 2) Sometimes {{scanCount}} is located inside {{/++ ... ++/}} comments, not in 
> {{/* ... */}}
> As a result, it generates local plans for perfStat that differ only by 
> {{{}scanCount{}}}, which makes {{perfStat}} heavier
> An example is given below.
> Before:
>  
> {noformat}
> SELECT 
>     u.id, 
>     u.name 
> FROM users u 
> WHERE u.active = true
> /* scanCount: 1 */
> UNION ALL
> SELECT 
>     c.id, 
>     c.contact_name 
> FROM customers c 
> WHERE c.status = 'VIP';
> /* scanCount: 3 */
> {noformat}
> After:
> {noformat}
> SELECT  
>     u.id, 
>     u.name 
> FROM users u 
> WHERE u.active = true
> UNION ALL
> SELECT  
>     c.id, 
>     c.contact_name 
> FROM customers c 
> WHERE c.status = 'VIP'
> ORDER BY name;
> {noformat}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to