1. 21 11月, 2017 16 次提交
    • H
      Remove unnecessary serial columns from a few upstream tests. · ea42a1cf
      Heikki Linnakangas 提交于
      These had been added in GPDB a long time ago, presumably to make the test
      output repeatable. But they're not needed anymore. Remove them to match
      the upstream more closely, which helps when merging.
      ea42a1cf
    • H
      Remove obsolete ax_pthread.m4 file. · d068edba
      Heikki Linnakangas 提交于
      It has been superseded by acx_pthread.m4, and was unused.
      d068edba
    • V
      cd60609f
    • H
      Fix race condition between DROP IF EXISTS and RENAME again. · 4dc999fb
      Heikki Linnakangas 提交于
      If a DROP IF EXISTS is run concurrently with ALTER TABLE RENAME TO, it's
      possible that the table gets dropped on master, but not on the segments.
      This was fixed earlier already, by commit 4739cd22, but the fix got lost
      during the 8.4 merge. Fix it again, in the same fashion, and also add
      a test case so that it won't get lost again, at least not in exactly the
      same manner.
      
      Spotted by @kuien, github issue #3874. Thanks to @tvesely for the test
      case.
      4dc999fb
    • B
      Supporting Join Optimization Levels in GPORCA · c8192690
      Bhuvnesh Chaudhary 提交于
      The concept of optimization levels is known in many enterprise
      optimizers. It enables user to handle the degree of optimization that is
      being employed. The optimization levels allow the grouping of
      transformations into bags of rules (where each is assigned a particular
      level). By default all rules are applied, but if a user wants to apply
      fewer rules they are able to. This decision is made by them based on
      domain knowledge, and they know even with fewer rules being applied the
      plan generated satisfies their needs.
      
      The Cascade optimizer, on which GPORCA is based on, allows grouping of
      transformation rules into optimization levels. This concept of
      optimization levels has also been extended to join ordering allowing
      user to pick the join order via the query or, use greedy approach or use
      exhaustive approach.
      
      Postgres based planners use join_limit and from_limit to reduce the
      search space. While the objective of Optimization/Join is also to reduce
      search space, but the way it does it is different. It is requesting the
      optimizer to apply or not apply a subset of rules and providing more
      flexibility to the customer. This is one of the most frequently
      requested feature from our enterprise clients who have high degree of
      domain knowledge.
      
      This PR introduces this concept. In the immediate future we are planning
      to add different polynomial join ordering techniques with guaranteed
      bound as part of the "Greedy" search.
      Signed-off-by: NHaisheng Yuan <hyuan@pivotal.io>
      c8192690
    • L
      56972aca
    • L
      7852dd15
    • K
    • H
      Refactor dynamic index scans and bitmap scans, to reduce diff vs. upstream. · 198f701e
      Heikki Linnakangas 提交于
      Much of the code and structs used by index scans and bitmap index scans had
      been fused together and refactored in GPDB, to share code between dynamic
      index scans and regular ones. However, it would be nice to keep upstream
      code unchanged as much as possible. To that end, refactor the exector code
      for dynamic index scans and dynamic bitmap index scans, to reduce the diff
      vs upstream.
      
      The Dynamic Index Scan executor node is now a thin wrapper around the
      regular Index Scan node, even thinner than before. When a new Dynamic Index
      Scan begins, we don't do much initialization at that point. When the scan
      begins, we initialize an Index Scan node for the first partition, and
      return rows from it until it's exhausted. On next call, the underlying
      Index Scan is destroyed, and a new Index Scan node is created, for the next
      partition, and so on. Creating and destroying the IndexScanState for every
      partition adds some overhead, but it's not significant compared to all the
      other overhead of opening and closing the relations, building scan keys
      etc.
      
      Similarly, a Dynamic Bitmap Index Scan executor node is just a thin wrapper
      for regular Bitmap Index Scan. When MultiExecDynamicBitmapIndexScan() is
      called, it initializes an BitmapIndexScanState for the current partition,
      and calls it. On ReScan, the BitmapIndexScan executor node for the old
      partiton is shut down. A Dynamic Bitmap Index Scan differs from Dynamic
      Index Scan in that a Dynamic Index Scan is responsible for iterating
      through all the active partitions, while a Dynamic Bitmap Index Scan works
      as a slave for the Dynamic Bitmap Heap Scan node above it.
      
      It'd be nice to do a similar refactoring for heap scans, but that's for
      another day.
      198f701e
    • H
      Oops, missed a comma. · 23feb165
      Heikki Linnakangas 提交于
      23feb165
    • H
      Don't bother to update distributed clog on sub-commit. · 21ff60e0
      Heikki Linnakangas 提交于
      The distributed clog, like normal clog, will not be consulted for
      subtransactions that are part of a still-in-progress transaction, so there
      is no need to update it until we're ready to commit the top transaction.
      This is basically the same changes that was done in the upstream for clog
      in commit 06da3c57. We're about to merge that change from the upstream as
      part of the PostgreSQL 8.4 merge, but we can make that change for the
      distributed log separately, to keep the actual merge commit smaller.
      21ff60e0
    • H
      Fix indentation in smgr code. · 14cb19b4
      Heikki Linnakangas 提交于
      By running pgindent, and tidying a bunch of things manually.
      14cb19b4
    • H
      Move some GPDB-specific code out of smgr.c and md.c. · 306b189d
      Heikki Linnakangas 提交于
      For clarity, and to make merging easier.
      
      The code to manage the hash table of "pending resync EOFs" for append-only
      tables is moved to smgr_ao.c. One notable change here is that the
      pendingDeletesPerformed flag is removed. It was used to track whether there
      are any pending deletes, or any pending AO table resyncs, but we might as
      well check the pending delete list and the pending syncs hash table
      directly, it's hardly any slower than checking a separate boolean.
      
      There are still plenty of GPDB changes in smgr.c, but this is a good step
      forward.
      306b189d
    • H
      Remove unnecessary ORDER BYs from upstream tests. · cc6b462b
      Heikki Linnakangas 提交于
      These were added in GPDB a long time ago, probably before gpdiff.pl was
      introduced to mask row order differences in regression test output. But
      now that gpdiff.pl can do that, these are unnecessary. Revert to match
      the upstream more closely.
      
      This includes updates to the 'rules' and 'inherit' tests, although they
      are disabled and still doesn't pass after these changes.
      cc6b462b
    • J
      I broke the build · ec4c2db4
      Jesse Zhang 提交于
      Fix it for realz. :(
      ec4c2db4
    • J
      Bump ORCA version to 2.49.1 · 240734df
      Jesse Zhang 提交于
      240734df
  2. 20 11月, 2017 3 次提交
  3. 19 11月, 2017 1 次提交
    • H
      Use the new 8.3 style when printing Access Privileges in psql. · ef408151
      Heikki Linnakangas 提交于
      Long time ago, when updating our psql version to 8.3 (or something higher),
      we had decided to keep the old single-line style when displaying access
      privileges, to avoid having to update regression tests. It's time to move
      forward, update the tests, and use the nicer 8.3 style for displaying
      access privileges.
      
      Also, \d on a view no longer prints the View Definition. You need to use
      the verbose \d+ option for that. (I'm not a big fan of that change myself:
      when I want to look at a view I'm almost always interested in the View
      Definition. But let's not second-guess decisions made almost 10 years ago
      in the upstream.)
      
      Note: psql still defaults to the "old-ascii" style when printing multi-line
      fields. The new style was introduced only later, in 9.0, so to avoid
      changing all the expected output files, we should stick to the old style
      until we reach that point in the merge. This commit only changes the style
      for Access privileges, which is different from the multi-line style.
      ef408151
  4. 18 11月, 2017 2 次提交
  5. 17 11月, 2017 6 次提交
  6. 16 11月, 2017 12 次提交
    • D
      Fix _optimizer file for HASH partition removal · 456e59e0
      Daniel Gustafsson 提交于
      This was lost in commit 152d1223 which has the corresponding
      update for the postgres planner output.
      456e59e0
    • D
      Refactor and simplify coerce_partition_value() · 62f45b47
      Daniel Gustafsson 提交于
      Avoid the extra string copy by using the StringInfo buffer and
      simplify the code a bit now that HASH partitions are removed.
      62f45b47
    • D
      Remove PARTTYPE_REFERENCE · c71d40f9
      Daniel Gustafsson 提交于
      The REFERENCE partition type was never used anywhere except being
      defined in the parttyp enum. Remove.
      c71d40f9
    • D
      Remove hash partitioning support · 152d1223
      Daniel Gustafsson 提交于
      Hash partitioning was never fully implemented, and was never turned
      on by default. There has been no effort to complete the feature, so
      rather than carrying dead code this removes all support for hash
      partitioning. Should we ever want this feature, we will most likely
      start from scratch anyways.
      
      As an effect from removing the unsupported MERGE/MODIFY commands,
      this previously accepted query is no longer legal:
      
      	create table t (a int, b int)
      	distributed by (a)
      	partition by range (b) (start () end(2));
      
      The syntax was an effect of an incorrect rule in the parser which
      made the start boundary optional for CREATE TABLE when it was only
      intended for MODIFY PARTITION.
      
      pg_upgrade was already checking for hash partitions so no new check
      was required (upgrade would've been impossible anyways due to hash
      algorithm change).
      152d1223
    • H
      Fix clash on two test tables named 'foo'. · 739db3a2
      Heikki Linnakangas 提交于
      A Concourse job just failed with a diff like this:
      
      *** ./expected/partition_pruning.out	2017-11-16 08:38:51.463996042 +0000
      --- ./results/partition_pruning.out	2017-11-16 08:38:51.691996042 +0000
      ***************
      *** 5785,5790 ****
      --- 5786,5793 ----
      
        -- More Equality and General Predicates ---
        drop table if exists foo;
      + ERROR:  "foo" is not a base table
      + HINT:  Use DROP EXTERNAL TABLE to remove an external table.
        create table foo(a int, b int)
        partition by list (b)
        (partition p1 values(1,3), partition p2 values(4,2), default partition other);
      
      That's because both 'partition_pruning' and 'portals_updatable' use a test
      table called 'foo', and they are run concurrently in the test scheudle. If
      the above 'drop table' happens to run at just the right time, when the table
      is created but not yet dropped in 'portals_updatable', you get that error.
      The test table in 'partitions_pruning' is created in a different schema,
      so creating two tables with the same name would actually be a problem, but
      the 'drop table' sees the table created in the public schema, too.
      
      To fix, rename the table in 'portals_updatable', and also remove the above
      unnecessary 'drop table. Either one would be enough to fix the race
      condition, but might as well do both.
      739db3a2
    • D
      Small refactoring of ALTER ROLE .. RESOURCE QUEUE · 0a4af85c
      Daniel Gustafsson 提交于
      Removing commented out code which is incorrect, resqueue comes from
      a defelem which in turn is parsed with the IDENT rule and thus is
      guaranteed to be lowercased. Also collapse the two identical if
      statements into one since the latter will never fire due to the
      condition being changed the former. This removes indentation and
      simplifies the code a bit.
      
      Also concatenate the error message making it easier to grep for and
      end error hint with a period (following the common convention in
      postgres code).
      0a4af85c
    • X
      resgroup: Fix memory quota calculation · c1cdb99d
      xiong-gang 提交于
      If a QD exits when the transaction is still active, QD will abort
      the transaction and destroy all gangs, without waiting for QEs
      finish the transaction. In this case, a new transaction (the resource
      group slot waken up by this QD) may execute before the QEs exit,
      so we cannot use the number of currently running QEs to calculate
      the memory quota.
      c1cdb99d
    • D
      Remove unused behave step · a6348eb7
      Daniel Gustafsson 提交于
      Any trailing commas were intended to be removed from the partition
      string, but due to a typo the fixed string was saved into a new
      variable instead. However, Chris Hajas realized that the step was
      no longer in use to remove it rather than fix it.
      a6348eb7
    • H
      Remove attempt to make EXPLAIN print something even on error. · ca4c29d4
      Heikki Linnakangas 提交于
      Compared to upstream, there was a bunch of changes to the error handling
      in EXPLAIN, to try to catch errors and produce EXPLAIN output even when an
      error happens. I don't understand how it was supposed to work, but I don't
      remember it ever doing anything too useful. And it has the strange effect
      that if an ERROR happens during EXPLAIN ANALYZE, it is reported to the
      client as merely a NOTICE. So, revert this to the way it is in the
      upstream.
      
      Also reorder the end-of-EXPLAIN steps so that the "Total runtime" is
      printed at the very end, like in the upstream. I don't see any reason to
      differ from upstream on that, and this makes the "Total runtime" numbers
      more comparable with PostgreSQL's, for what it's worth.
      
      I dug up the commit that made these changes in the old git repository, from
      before GPDB was open sourced:
      
      ---
      commit 1413010e71cb8eae860160ac9d5246216b2a80b4
      Date:   Thu Apr 12 12:34:18 2007 -0800
      
          MPP-1177. EXPLAIN ANALYZE now can usually produce a report,
          perhaps a partial one, even if the query encounters a runtime
          error.  The Slice Statistics indicate 'ok' for slices whose worker
          processes all completed successfully; otherwise it shows how many
          workers returned errors, were canceled, or were not dispatched.
      
          The error message from EXPLAIN in such cases will appear as a
          NOTICE instead of an ERROR.  The client is first sent a successful
          completion response, followed by the NOTICE.  (psql displays the
          NOTICE before the EXPLAIN report, however.)  Although presented to
          the client as a NOTICE, the backend handles it just like an ERROR
          with regard to logging, rollback, etc.
      ---
      
      I couldn't figure out under what circumstances that would be helpful,
      and couldn't come up with an example. Perhaps it used to work differently
      when it was originally committed, but not anymore? I also looked up the
      MPP-1177 ticket in the old bug tracking system. The description for that
      was:
      
      ---
      EXPLAIN ANALYZE should report on the amount of data spilled to temporary
      workfiles on disk, and how much work_mem would be required to complete
      the query without spilling to disk.
      ----
      
      Unfortunately, that description, and the comments that followed it, didn't
      say anything about suppressing errors or being able to print out EXPLAIN
      output even if an error happens. So I don't know why that change was made
      as part of MPP-1177. It was seemingly for a different issue.
      ca4c29d4
    • H
      Silence warnings about deprecated bison flags. · b4d323c6
      Heikki Linnakangas 提交于
      In Makefile.global, we set BISONFLAGS to "-Wno-deprecated". Don't override
      that in the gpmapreduce's Makefile. Put the -d flag directly to the bison
      invocation's command-line, like it's done e.g. in src/backend/parser.
      b4d323c6
    • A
      9d85a367
    • A
      Retire the gpcloud_pipeline.yml · f10a8ca9
      Adam Lee 提交于
      `kick-off` script is good enough for gpcloud tests, retire the
      gpcloud_pipeline then.
      f10a8ca9