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

ADBDEV-4152: Optimize the Explicit Redistribute application logic #666

Merged
merged 85 commits into from
Mar 21, 2024

Commits on Jan 30, 2024

  1. Check for Motions before scan if requesting Explicit Redistribute Motion

    Previously, `Explicit Redistribute Motion` was added if there were any motions
    in the subplan, ignoring any motions in `InitPlans`.
    
    This patch updates the logic: if an `Explicit Redistribute Motion` has no
    motions underneath it's subtree, then the row to update must originate from the
    same segment, and no `Explicit Redistribute Motion` is needed. If there are any
    motions, `Explicit Redistribute Motion` should be added only if there is a
    motion between the scan and the `ModifyTable` on the relation we are going to
    update.
    
    Even if previous Motions were performed on a leaf partition or inherited table,
    targetlists from Motions refer to relids of their parents. So, if relid has a
    superclass, we should check for inheritance instead of comparing Oids.
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    fa1e719 View commit details
    Browse the repository at this point in the history
  2. Update tests

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    51960cd View commit details
    Browse the repository at this point in the history
  3. Update tests for optimizer

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    4d5edb5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cbb6f6b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    684ac6a View commit details
    Browse the repository at this point in the history
  6. Clean up

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    da58c43 View commit details
    Browse the repository at this point in the history
  7. Apply remarks

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    208903b View commit details
    Browse the repository at this point in the history
  8. Run pgindent

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    848cc16 View commit details
    Browse the repository at this point in the history
  9. Look into hashExprs for Redistribute Motion

    While checking the assumption that the right subtree is more frequent, I found
    out that target list of `Redistribute Motion` may contain columns which are not
    used for distribution. Behavior was correct only because the right subtree is
    checked first. In cases when the scan would be in the left subtree, this is
    incorrect, and `hashExprs` need to be checked instead.
    
    Checking `hashExprs` may contain different structures that inherit `Expr` node.
    The structure we need is of type `Var`, because it's the only child of `Expr`
    node that we can get relation ID from.
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    b24fea9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2144872 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    671b439 View commit details
    Browse the repository at this point in the history
  12. Run pgindent

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    7c19171 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e61fbf3 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e0e839c View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    aad110b View commit details
    Browse the repository at this point in the history
  16. Clean up

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    b775728 View commit details
    Browse the repository at this point in the history
  17. Remove extra checks

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    8e69fae View commit details
    Browse the repository at this point in the history
  18. Fix formatting

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    9ebcff5 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    951ece2 View commit details
    Browse the repository at this point in the history
  20. Revert "Fix isChecking being enabled for INSERT ModifyTable after fir…

    …st Explicit Motion"
    
    This reverts commit 8cfe09c.
    Explicit Redidistribute Motion is not requested unless IT IS
    UPDATE/DELETE
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    049d111 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    db1b2f4 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    ec27689 View commit details
    Browse the repository at this point in the history
  23. Fix a test

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    894ffd3 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    7d9eea9 View commit details
    Browse the repository at this point in the history
  25. Revert "Change comments, since varnoold is used"

    This reverts commit 955356e.
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    3531176 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    0225657 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    5281022 View commit details
    Browse the repository at this point in the history
  28. Change List to Bitmapset

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    7efdd12 View commit details
    Browse the repository at this point in the history
  29. Use getrelid macro

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    4f609c4 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    fe9905b View commit details
    Browse the repository at this point in the history
  31. Revert "Fix a test"

    This reverts commit e5fbce1.
    
    Explicit Redistribute Motion here is unnecessary.
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    98132eb View commit details
    Browse the repository at this point in the history
  32. Ignore motions in InitPlans

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    d5f68e1 View commit details
    Browse the repository at this point in the history
  33. Fix comment in test

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    31f4f3e View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    5a53ecd View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    bf60efa View commit details
    Browse the repository at this point in the history
  36. Squash if condition

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    a60385f View commit details
    Browse the repository at this point in the history
  37. Add a comment

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    8d91f93 View commit details
    Browse the repository at this point in the history
  38. Squash if condition

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    c0d7269 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    a99c4b1 View commit details
    Browse the repository at this point in the history
  40. Revert "Fix nMotionsAbove not decrementing when we already found moti…

    …ons"
    
    This reverts commit 99b32b3.
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    43b562b View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    2f170f8 View commit details
    Browse the repository at this point in the history
  42. Check if scan retrieves ctid

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    44e7492 View commit details
    Browse the repository at this point in the history
  43. Add missing assert

    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    7eb73d5 View commit details
    Browse the repository at this point in the history
  44. Revert "Check if scan retrieves ctid"

    This reverts commit e7a5544.
    bandetto committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    b6f5049 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    b0bebc8 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. Get rid of rti variable

    bandetto committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    38beaa2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b8c919c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b98b7b View commit details
    Browse the repository at this point in the history
  4. Simplify motion conditions

    bandetto committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    d2c801a View commit details
    Browse the repository at this point in the history
  5. Fix comments

    bandetto committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    11be3ca View commit details
    Browse the repository at this point in the history
  6. Ignore DROP TABLE

    bandetto committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    73aac4c View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2024

  1. Configuration menu
    Copy the full SHA
    053ea46 View commit details
    Browse the repository at this point in the history
  2. Count gather motions as well

    bandetto committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    289068b View commit details
    Browse the repository at this point in the history
  3. Add test for gather motion

    bandetto committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    5f2299f View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2024

  1. Fix comment

    bandetto committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    a270ca1 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2024

  1. Remove extra break

    bandetto committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    8d7fd19 View commit details
    Browse the repository at this point in the history
  2. Clean up tests

    bandetto committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    2970372 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Remove flaky ORCA test

    bandetto committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    4bef525 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    16fc477 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    de565c2 View commit details
    Browse the repository at this point in the history
  4. Adjust comments

    bandetto committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    bf188a4 View commit details
    Browse the repository at this point in the history
  5. Remove the braces

    bandetto committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    267077f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4ffca2a View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. Update comments

    bandetto committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    9d35370 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    54dec02 View commit details
    Browse the repository at this point in the history
  3. Squash if condition

    bandetto committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    a628050 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2024

  1. Configuration menu
    Copy the full SHA
    4b43f33 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8ec1f0 View commit details
    Browse the repository at this point in the history
  3. Remove blank line

    bandetto committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    63f63cd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4301bf6 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2024

  1. Configuration menu
    Copy the full SHA
    71dbb77 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5e69424 View commit details
    Browse the repository at this point in the history
  3. Replace loop with search

    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    e32d271 View commit details
    Browse the repository at this point in the history
  4. Squash if condition

    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    d927e62 View commit details
    Browse the repository at this point in the history
  5. Squash if condition 2

    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    2d4550c View commit details
    Browse the repository at this point in the history
  6. if -> else if

    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    8504082 View commit details
    Browse the repository at this point in the history
  7. Fix alignment

    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    3e6acf1 View commit details
    Browse the repository at this point in the history
  8. Try to restore ABI

    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    bc89960 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    cd9b81f View commit details
    Browse the repository at this point in the history
  10. Revert "Try to restore ABI"

    This reverts commit bc89960.
    bandetto committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    3f250be View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    24a0b49 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. Configuration menu
    Copy the full SHA
    f2b9cbd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15d2190 View commit details
    Browse the repository at this point in the history
  3. Update a comment

    bandetto committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    b19810b View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

  1. Revert "Get rid of extra logic and tests related to InitPlans"

    Skip InitPlans, but don't restore a useless test.
    
    This reverts commit bb559fd236bda017152005fa8eebfc0b58751695.
    bandetto committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    d00b0e3 View commit details
    Browse the repository at this point in the history