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

С predicate extract 2.0 не работает indexlookupjoin #2527

Closed
ssmike opened this issue Mar 6, 2024 · 0 comments
Closed

С predicate extract 2.0 не работает indexlookupjoin #2527

ssmike opened this issue Mar 6, 2024 · 0 comments
Assignees

Comments

@ssmike
Copy link
Collaborator

ssmike commented Mar 6, 2024

Запрос

 DECLARE $param1 AS Utf8;
  DECLARE $field2 AS Utf8;
  DECLARE $last_id AS Utf8;
  DECLARE $limit AS UInt64;

  SELECT
    t.id AS target_id,
    t.addr AS addr,
    t.zone_id AS zone_id,
    h.name AS name,
    hra.changed_at ?? 0 AS changed_at,
    hra.field2 ?? $status AS status,
    t.forced_field2 ?? 0 AS forced_status,
  FROM entity_groups AS gh
  JOIN entitys AS h
    ON gh.entity_id = h.id
  JOIN entity_targets__id__addr_id__target_id__index AS ti
    ON h.id = ti.entity_id
  JOIN entity_targets AS t
    ON ti.target_id = t.id
  LEFT JOIN entity_results_aggregation AS hra
    ON t.id = hra.target_id
  WHERE gh.subkey = $param1
  AND t.id > $last_id
  ORDER BY target_id
  LIMIT $limit;

Чтение таблицы entity_targets переписывается в широкий scan по условию id > $last_id, а не в lookup ключей соответствующих левой части join

@ssmike ssmike changed the title С predicate extract 2.0 в некотором классе запросов не работает indexlookupjoin С predicate extract 2.0 не работает indexlookupjoin Mar 6, 2024
@ssmike ssmike self-assigned this Mar 7, 2024
Krock21 pushed a commit to Krock21/ydb that referenced this issue Mar 8, 2024
Krock21 pushed a commit to Krock21/ydb that referenced this issue Mar 8, 2024
@ssmike ssmike closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant