Aleksandr Chesnokov created IGNITE-26438:
--------------------------------------------

             Summary: Normalize SQL plan: remove H2 system-generated subquery 
aliases
                 Key: IGNITE-26438
                 URL: https://issues.apache.org/jira/browse/IGNITE-26438
             Project: Ignite
          Issue Type: Improvement
            Reporter: Aleksandr Chesnokov


H2 automatically generates system aliases for derived tables in the form 
{{_<number>}} (e.g., {{{}_10045{}}}).

These aliases have no business meaning but cause logically identical SQL plans 
to be stored as different texts, increasing storage size.

This has two consequences:
 # The *PerfStat* report becomes heavier than necessary.
 # The *sql.plans.history* system view grows larger, storing redundant entries.

Example:

Before:
{noformat}
SELECT _10045.id, _10045.name
FROM (
    SELECT id, name
    FROM users
) _10045
WHERE _10045.id = 1;{noformat}
After:
{noformat}
SELECT id, name
FROM (
    SELECT id, name
    FROM users
)
WHERE id = 1;{noformat}



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

Reply via email to