1. 02 8月, 2019 1 次提交
    • B
      Support GIN Indexes with ORCA. · eae823f4
      Bhuvnesh Chaudhary 提交于
      This commit adds the GPDB side changes required to support GIN Indexes with
      ORCA.  It also adds a new test file gp_gin_indexes to test plans produced for
      ORCA/planner.
      
      GIN indexes are not supported with index expression or predicate constraints.
      ORCA does not support it currently for other types of indexes too.
      eae823f4
  2. 13 2月, 2019 1 次提交
  3. 19 12月, 2018 1 次提交
    • H
      Replace GPDB-specific bms_first_from() with upstream bms_next_member(). · 647ac80b
      Heikki Linnakangas 提交于
      bms_next_member() is added in 9.5. Might as well backport that now, to
      eliminate the redundant bms_first_from().
      
      In the passing, revert a couple of spurious GPDB differences vs upstream:
      
      * Resurrect the rightmost_one_pos lookup table. I'm not sure why that was
        done differently, but presumably the lookup table is faster, and that's
        what upstream uses anyway.
      
      * Use plain / and % in WORDNUM and BITNUM macros. The compiler will surely
        turn them into the equivalent CPU instructions, using >> and &.
      647ac80b
  4. 03 12月, 2018 1 次提交
  5. 11 8月, 2018 1 次提交
    • A
      Adding GiST support for GPORCA · ec3693e6
      Ashuka Xue 提交于
      Prior to this commit, there was no support for GiST indexes in GPORCA.
      For queries involving GiST indexes, ORCA was selecting Table Scan paths
      as the optimal plan. These plans could take up to 300+ times longer than
      Planner, which generated a index scan plan using the GiST index.
      
      Example:
      ```
      CREATE TABLE gist_tbl (a int, p polygon);
      CREATE TABLE gist_tbl2 (b int, p polygon);
      CREATE INDEX poly_index ON gist_tbl USING gist(p);
      
      INSERT INTO gist_tbl SELECT i, polygon(box(point(i, i+2),point(i+4,
      i+6))) FROM generate_series(1,50000)i;
      INSERT INTO gist_tbl2 SELECT i, polygon(box(point(i+1, i+3),point(i+5,
      i+7))) FROM generate_series(1,50000)i;
      
      ANALYZE;
      ```
      With the query `SELECT count(*) FROM gist_tbl, gist_tbl2 WHERE
      gist_tbl.p <@ gist_tbl2.p;`, we see a performance increase with the
      support of GiST.
      
      Before:
      ```
      EXPLAIN SELECT count(*) FROM gist_tbl, gist_tbl2 WHERE gist_tbl.p <@ gist_tbl2.p;
                                                           QUERY PLAN
      ---------------------------------------------------------------------------------------------------------------------
       Aggregate  (cost=0.00..171401912.12 rows=1 width=8)
         ->  Gather Motion 3:1  (slice2; segments: 3)  (cost=0.00..171401912.12 rows=1 width=8)
               ->  Aggregate  (cost=0.00..171401912.12 rows=1 width=8)
                     ->  Nested Loop  (cost=0.00..171401912.12 rows=335499869 width=1)
                           Join Filter: gist_tbl.p <@ gist_tbl2.p
                           ->  Table Scan on gist_tbl2  (cost=0.00..432.25 rows=16776 width=101)
                           ->  Materialize  (cost=0.00..530.81 rows=49997 width=101)
                                 ->  Broadcast Motion 3:3  (slice1; segments: 3)  (cost=0.00..525.76 rows=49997 width=101)
                                       ->  Table Scan on gist_tbl  (cost=0.00..432.24 rows=16666 width=101)
       Optimizer status: PQO version 2.65.1
      (10 rows)
      
      Time: 170.172 ms
      SELECT count(*) FROM gist_tbl, gist_tbl2 WHERE gist_tbl.p <@ gist_tbl2.p;
       count
      -------
       49999
      (1 row)
      
      Time: 546028.227 ms
      ```
      
      After:
      ```
      EXPLAIN SELECT count(*) FROM gist_tbl, gist_tbl2 WHERE gist_tbl.p <@ gist_tbl2.p;
                                                        QUERY PLAN
      ---------------------------------------------------------------------------------------------------------------
       Aggregate  (cost=0.00..21749053.24 rows=1 width=8)
         ->  Gather Motion 3:1  (slice2; segments: 3)  (cost=0.00..21749053.24 rows=1 width=8)
               ->  Aggregate  (cost=0.00..21749053.24 rows=1 width=8)
                     ->  Nested Loop  (cost=0.00..21749053.24 rows=335499869 width=1)
                           Join Filter: true
                           ->  Broadcast Motion 3:3  (slice1; segments: 3)  (cost=0.00..526.39 rows=50328 width=101)
                                 ->  Table Scan on gist_tbl2  (cost=0.00..432.25 rows=16776 width=101)
                           ->  Bitmap Table Scan on gist_tbl  (cost=0.00..21746725.48 rows=6667 width=1)
                                 Recheck Cond: gist_tbl.p <@ gist_tbl2.p
                                 ->  Bitmap Index Scan on poly_index  (cost=0.00..0.00 rows=0 width=0)
                                       Index Cond: gist_tbl.p <@ gist_tbl2.p
       Optimizer status: PQO version 2.65.1
      (12 rows)
      
      Time: 617.489 ms
      
      SELECT count(*) FROM gist_tbl, gist_tbl2 WHERE gist_tbl.p <@ gist_tbl2.p;
       count
      -------
       49999
      (1 row)
      
      Time: 7779.198 ms
      ```
      
      GiST support was implemented by sending over GiST index information to
      GPORCA in the metadata using a new index enum specifically for GiST.
      Signed-off-by: NBhuvnesh Chaudhary <bchaudhary@pivotal.io>
      Signed-off-by: NEkta Khanna <ekhanna@pivotal.io>
      ec3693e6
  6. 13 7月, 2018 1 次提交
  7. 12 7月, 2018 1 次提交
    • R
      Fix invalid reference to relcache entries. · 234150b7
      Richard Guo 提交于
      Fix invalid reference to relcache entries.
      
      After a relation is closed, the relcache entry
      might be freed if its refcount goes to zero and we
      should avoid further reference to it.
      
      This is a fix to already existing bug and current
      tests can cover the code changes here. So there is
      no need to add new test case.
      234150b7
  8. 18 1月, 2018 1 次提交
  9. 13 1月, 2018 1 次提交
    • H
      Remove remnants of persistent tables. · 334476ad
      Heikki Linnakangas 提交于
      They were not kept up-to-date anymore anyway. Remove the actual tables.
      
      There are still a few references to these tables in the management tools.
      AFAICS they're in tests, and I was hesitent to remove them just yet, in
      case we're going to use the existing tests as a guide when writing new
      tests.
      334476ad
  10. 14 11月, 2017 1 次提交
  11. 10 10月, 2017 2 次提交
  12. 01 9月, 2017 1 次提交
  13. 09 8月, 2017 2 次提交
  14. 24 11月, 2016 2 次提交
    • D
      Clean up style and formatting · 0f2ba044
      Daniel Gustafsson 提交于
      This fixes up whitespace and formatting issues in the code touched
      by the last new commits. Separated into a single commit for easier
      diff reading of the actual code changes.
      0f2ba044
    • D
      Guard against possible NULL pointer dereferencing · 280416b7
      Daniel Gustafsson 提交于
      Improves defensiveness of programming around pointer derefencing to
      ensure that we don't risk a NULL pointer. Most of these are quite
      straight-forward, those of note are discussed below.
      
      In doDispatchDtxProtocolCommand() we relied on the result data being
      created in zeroed out memory on CdbDispatchDtxProtocolCommand() which
      isn't guaranteed for every compiler. Explcitly set numResults to zero
      and also check the results for NULL.
      
      Per multiple reports by Coverity
      280416b7
  15. 25 8月, 2016 3 次提交
  16. 12 2月, 2016 1 次提交
  17. 07 1月, 2016 1 次提交
  18. 28 10月, 2015 1 次提交