1. 29 9月, 2020 1 次提交
    • J
      Format ORCA and GPOPT. · 219fe0c4
      Jesse Zhang 提交于
      The canonical config file is in src/backend/gpopt/.clang-format (instead
      of under the non-existent src/backend/gporca), I've created one (instead
      of two) symlink, for GPOPT headers. Care has been taken to repoint the
      symlink to the canonical config under gpopt, instead of gpopt as it is
      under HEAD.
      
      This is spiritually a cherry-pick of commit 2f7dd76c.
      (cherry picked from commit 2f7dd76c)
      219fe0c4
  2. 05 2月, 2020 1 次提交
  3. 17 9月, 2019 1 次提交
  4. 13 9月, 2019 1 次提交
    • A
      Pass stats for UUID columns to ORCA · bbb529bc
      Abhijit Subramanya 提交于
      Previously we would not pass the statistics for UUID columns to ORCA. This
      would cause cardinality mis-estimation and hence would cause ORCA to pick a bad
      plan. This patch fixes the issue by passing in the statistics for UUID columns.
      bbb529bc
  5. 01 6月, 2019 1 次提交
  6. 01 3月, 2019 1 次提交
  7. 16 8月, 2018 1 次提交
  8. 15 2月, 2018 2 次提交
    • S
      Use default typmod (-1) for stats · 14575edc
      Shreedhar Hardikar 提交于
      Signed-off-by: NJesse Zhang <sbjesse@gmail.com>
      (cherry picked from commit 16d53f26)
      14575edc
    • J
      Add type modifiers (typmod) support to ORCA · 1c37d8af
      Jesse Zhang 提交于
      ORCA has historically ignored type modifiers from databases that support
      them, noticeably Postgres and Greenplum. This has led to surprises in a
      few cases:
      
      1. The output description over the wire (for Postgres protocol) will
      lose the type modifier information, which often meant length. This
      surprises code that expects a non-default type modifier, e.g. a JDBC
      driver.
      
      2. The executor in some cases -- notably DML -- expects a precise type
      modifier. Because ORCA always erases the type modifiers and presents a
      default, the executor is forced to find that information elsewhere.
      
      After this commit, ORCA will be aware of type modifiers in table
      columns, scalar identifiers, constants, and length-coercion casts.
      Signed-off-by: NShreedhar Hardikar <shardikar@pivotal.io>
      (cherry picked from commit 2d907526)
      1c37d8af
  9. 25 1月, 2018 1 次提交
  10. 03 1月, 2018 1 次提交
  11. 12 9月, 2017 2 次提交
  12. 26 8月, 2017 1 次提交
    • H
      Remove winlevelsup field, to the extent possible without catalog change. · 563c8c6b
      Heikki Linnakangas 提交于
      The winlevelsup field isn't used. The reason it's not needed can be summed
      up by this comment in PostgreSQL 8.4's transformWindowFunc function:
      
      >  * Unlike aggregates, only the most closely nested pstate level need be
      >  * considered --- there are no "outer window functions" per SQL spec.
      
      Second line of reasoning is that the winlevelsup field was always
      initialized to 0, and only incremented in the IncrementVarSublevelsUp
      function. But that function is only used during planning, so winlevelsup
      was always 0 in the parse and parse analysis stage. However, the field was
      read only in the parse analysis phase, which means that it was always 0
      when it was read.
      
      Third line of reasoning is that the regression tests are happy without it,
      and there was a check in the ORCA translator too, that would've thrown
      an error if it was ever non-zero.
      
      I left the field in place in the struct, to avoid a catalog change, but it
      is now unsued. WindowRef nodes can be stored in catalogs, as part of views,
      I believe.
      563c8c6b
  13. 03 6月, 2017 1 次提交
    • H
      Make some const array variables static in gpopt translator · 53bb247e
      Haisheng Yuan 提交于
      Static variables when used inside function are initialized only once and stored
      on static storage area. The original code without static initializes these
      variables every time the function is called and these variables are stored in
      stack. Since we don't change the array value, they can be static const.
      53bb247e
  14. 25 4月, 2017 1 次提交
    • H
      Transform small Array constants to ArrayExprs. · 9a817d45
      Heikki Linnakangas 提交于
      ORCA can do some optimizations - partition pruning at least - if it can
      "see" into the elements of an array in a ScalarArrayOpExpr. For example, if
      you have a qual like "column IN (1, 2, 3)", and the table is partitioned on
      column, it can eliminate partitions that don't hold those values. The
      IN-clause is converted into an ScalarArrayOpExpr, so that is really
      equivalent to "column = ANY <array>"
      
      However, ORCA doesn't know how to extract elements from an array-typed
      Const, so it can only do that if the array in the ScalarArrayOpExpr is
      an ArrayExpr. Normally, eval_const_expressions() simplifies any ArrayExprs
      into Const, if all the elements are constants, but we had disabled that
      when ORCA was used, to keep the ArrayExprs visible to it.
      
      There are a couple of reasons why that was not a very good solution. First,
      while we refrain from converting an ArrayExpr to an array Const, it doesn't
      help if the argument was an array Const to begin with. The "x IN (1,2,3)"
      construct is converted to an ArrayExpr by the parser, but we would miss the
      opportunity if it's written as "x = ANY ('{1,2,3}'::int[])" instead.
      Secondly, by not simplifying the ArrayExpr, we miss the opportunity to
      simplify the expression further. For example, if you have a qual like
      "1 IN (1,2)", we can evaluate that completely at plan time to 'true', but
      we would not do that with ORCA because the ArrayExpr was not simplified.
      
      To be able to also optimize those cases, and to slighty reduce our diff
      vs upstream in clauses.c, always simplify ArrayExprs to Consts, when
      possible. To compensate, so that ORCA still sees ArrayExprs rather than
      array Consts (in those cases where it matters), when a ScalarArrayOpExpr
      is handed over to ORCA, we check if the argument array is a Const, and
      convert it (back) to an ArrayExpr if it is.
      Signed-off-by: NJemish Patel <jpatel@pivotal.io>
      9a817d45
  15. 21 1月, 2017 1 次提交
  16. 23 11月, 2016 1 次提交
    • H
      Remove broken leftover assertion. · 512ea64d
      Heikki Linnakangas 提交于
      I removed the 'pplstmt' argument in commit 413cb592, because all the
      callers passed NULL. But missed this assertion that still referenced it.
      Remove it, too.
      
      Per off-list report by Haisheng Yuan.
      512ea64d
  17. 10 11月, 2016 1 次提交
  18. 02 11月, 2016 1 次提交
  19. 04 10月, 2016 1 次提交
    • A
      Changes to make compilation with gcc-6.2.0 successful · 00ad4b5c
      Asim R P and Haisheng Yuan 提交于
      Orca translator changes reorder include statements so that system and
      PostgreSQL headers are grouped at the top.  Including such headers
      within a C++ namespace causes compilation to fail with the new GCC.
      
      The gpmonlib change removes inline keyword.  The new compiler is not
      happy with inlining a function defined in an external object.
      00ad4b5c
  20. 15 6月, 2016 1 次提交
  21. 10 5月, 2016 1 次提交
  22. 11 12月, 2015 1 次提交
    • E
      Refactor and cleanup of memory management of the new optimizer. · 9e5dd61a
      Entong Shen 提交于
      This commit eliminates the global new/delete overrides that were causing
      compatibility problems (the Allocators.(h/cpp/inl) files have been
      completely removed). The GPOS `New()` macro is retained and works the
      same way, but has been renamed `GPOS_NEW()` to avoid confusion and
      possible name collisions. `GPOS_NEW()` works only for allocating
      singleton objects. For allocating arrays, `GPOS_NEW_ARRAY()` is
      provided. Because we no longer override the global delete,
      objects/arrays allocated by `GPOS_NEW()` and `GPOS_NEW_ARRAY()` must now
      be deleted by the new functions `GPOS_DELETE()` and
      `GPOS_DELETE_ARRAY()` respectively. All code in GPOS has been
      retrofitted for these changes, but Orca and other code that depends on
      GPOS should also be changed.
      
      Note that `GPOS_NEW()` and `GPOS_NEW_ARRAY()` should both be
      exception-safe and not leak memory when a constructor throws.
      
      Closes #166
      9e5dd61a
  23. 24 11月, 2015 1 次提交
  24. 28 10月, 2015 1 次提交