1. 05 8月, 2016 2 次提交
    • F
      Extracting column names from ShareInputScan in ORCA plans to support proper... · 4075136b
      foyzur 提交于
      Extracting column names from ShareInputScan in ORCA plans to support proper column name resolution using RTE_CTE (#992)
      
      * Extracting column names from ShareInputScan in ORCA plans to support proper column name resolution using RTE_CTE.
      
      * Code review on PR 992.
      
      * PlannerGlobal has out-function support in the upstream, so removing it
        altogether doesn't seem like a good idea. I'm not sure if it get
        printed out with suitable verbose or debug flags, but I remember seeing
        it being printed out during debugging somehow, and it can be useful.
      
      * Refactor the functions in cdbmutate.c, so that there's a separate function
        to do the DAG to Tree conversion, and a separate function for just
        collecting the producer nodes. It seems like a bad idea that a function
        called "apply_dag_to_tree" actually does something different, depending
        on a flag in a struct.
      
      * Now that we have a separate array of producers, no need to hold the
        colnames etc. lists in ShareInputScan node itself. Since we can look up
        the producer node at will, we might as well look at the producer node's
        sub-tree directly every time we construct the CTE RTE.
      
      * One complication from the previous change is that we can't call
        get_tle_name() in replace_shareinput_targetlists(), because that runs
        after the post-processing in setrefs.c, so all Vars have already been
        changed to use INNER/OUTER. get_tle_name() doesn't work with those.
        On closer inspection, I think this was a bit fiddly in the ORCA case
        before too, because in ORCA-generated plans, Vars always use the
        INNER/OUTER notation, so calling get_tle_name() on an ORCA-generated
        plan was always questionable. It happened to work, becuase ORCA also
        makes seems to always fill in TargetEntry.resname, so get_tle_name()
        always just picked that, rather than looking up the range table entry.
        This new structuring of the code avoids relying on that assumption.
      
      * Refactored the code to create the fake CTE RTE to a separate function.
        replace_shareinput_targetlists_walker() had grown quite complex.
      
      * Use the producers array in setrefs.c
      
      * Get rid of separate sharedNodes list.
      
      Now that we have an array of producers, conveniently indexed by share_id,
      just use that. Mostly for sake of readability, although you might see
      a performance gain in corner-cases involving a huge number of share input
      scans.
      4075136b
    • O
      Update ivy.xml · 0718dca1
      Omer Arap 提交于
      0718dca1
  2. 04 8月, 2016 5 次提交
    • A
      Syslogger chooses incorrect name for alert file · 6c10daa0
      Alexey Grishchenko 提交于
      Error was introduced by PG 8.3 merge. In Postgres there is only one
      log, and its name pattern is set by global variable Log_filename.
      But in GPDB there is a separate alert log used by gpperfmon, and its
      file name is also generated by logfile_getname() function, and you
      have to use the passed pattern instead of global variable as a file
      name pattern, as alert filename pattern is "gpdb-alert-..."
      6c10daa0
    • S
      Fix cpplint errors · 697ffc1a
      Shreedhar Hardikar 提交于
      697ffc1a
    • F
      Using proper canSetTag during ORCA PlannedStmt translation (#1014) · d0ef76db
      foyzur 提交于
      * Fixing DXL Translator bug where we lose canSetTag during Query object mutation and the translator ends up using wrong canSetTag.
      
      * Adding ICG test for verifying the the ORCA translator uses correct canSetTag.
      d0ef76db
    • S
      Support Virtual Tuples and Memtuples in SlotGetAttrCodegen · c5e3aed4
      Shreedhar Hardikar 提交于
      We can avoid generating multiple versions of the slot_getattr. Once we
      deform any of the attributes in the tuples, we make it a virtual tuple.
      At code generation time, we know exactly how many need to be deformed
      and can in fact go ahead deform all the way. This way we don't need to
      worry about the case when slot_getattr is called on a virtual tuple with
      attnum > nvalid - that is deformation is partially complete.
      
      To enable this, we need to collect information from all the code
      generators that depend on SlotGetAttrCodegen before it is generated. We
      maintain a static map (keyed on the manager and the slot) to instances of
      SlotGetAttrCodegen. We also introduce a InitDependencies phase that
      happens before the GenerateCode phase, when dependants of
      SlotGetAttrCodegen can retrieve instances from the static map.
      c5e3aed4
    • S
      5996aaa7
  3. 03 8月, 2016 13 次提交
  4. 02 8月, 2016 16 次提交
    • H
      Make 'relstorage' available in RelOptInfo. · df55bb30
      Heikki Linnakangas 提交于
      There are quite a few places in the planner that need that information.
      Save a few system table lookups by keeping it in RelOptInfo. There is
      no syscache for pg_exttable. I don't see any measurable performance
      improvement from this, but you can see the number of index scans drop in
      pg_stat_sys_tables, and I think it makes the code slightly simpler anyway.
      df55bb30
    • H
      Reorder GPDB regression tests, for better concurrency. · d3e51c25
      Heikki Linnakangas 提交于
      This shaves a couple of minutes off the total runtime on my laptop.
      d3e51c25
    • H
      Move GPDB-specific tests from 'alter_table' to 'alter_table_ao'. · 256cfd0f
      Heikki Linnakangas 提交于
      Keeping upstream test files as close to upstream as possible helps with
      diffing and merging with upstream. There are more GPDB-specific changes
      there still, but this is a step in the right direction. The 'alter_table'
      test runs for quite a long time, so by running it more in parallel, this
      also shortens a installcheck-good run slightly.
      256cfd0f
    • H
      Remove unnecessary DROP commands from test file. · 89c3ea4f
      Heikki Linnakangas 提交于
      The test runs in a schema of its own, bfv_aggregate. It is created at
      the beginning of the test, so we can safely assume that it's empty.
      Also, rather than dropping created objects after each test, just drop
      the whole schema at the end.
      89c3ea4f
    • H
      Create and drop test tables in a transaction, to reduce 2PC overhead. · 850baebb
      Heikki Linnakangas 提交于
      In the passing, also add a DROP TABLE for the boolean test table. It
      was missing. Not that we necessarily need to drop every table created
      in a test case, but let's be consistent within the test file.
      850baebb
    • H
      Avoid database-wide VACUUM FULL in test case. · fc73eac7
      Heikki Linnakangas 提交于
      Vacuuming the single table ought to be enough.
      fc73eac7
    • H
      Get rid of AppendOnlyEntry struct. · 2818b911
      Heikki Linnakangas 提交于
      It's pretty much identical to Form_pg_appendonly, which is now available
      in the relcache. No need to pass this additional struct around.
      2818b911
    • H
      Store pg_appendonly tuple in relcache. · a4fbb150
      Heikki Linnakangas 提交于
      This way, you don't need to always fetch it from the system catalogs,
      which makes things simpler, and is marginally faster too.
      
      To make all the fields in pg_appendonly accessible by direct access to
      the Form_pg_appendonly struct, change 'compresstype' field from text to
      name. "No compression" is now represented by an empty string, rather than
      NULL. I hope there are no applications out there that will get confused
      by this.
      
      The GetAppendOnlyEntry() function used to take a Snapshot as argument,
      but that seems unnecessary. The data in pg_appendonly doesn't change for
      a table after it's been created. Except when it's ALTERed, or rewritten
      by TRUNCATE or CLUSTER, but those operations invalidate the relcache, and
      we're never interested in the old version.
      
      There's not much need for the AppendOnlyEntry struct and the
      GetAppendOnlyEntry() function anymore; you can just as easily just access
      the Form_pg_appendonly struct directly. I'll remove that as a separate
      commit, though, to keep this one more readable.
      a4fbb150
    • H
      Move function prototypes related to pg_appendonly to separate header file. · d6748dd6
      Heikki Linnakangas 提交于
      Many headers in src/include/catalog have gotten this treatment in the
      upstream. This makes life easier for the next commit, which adds a
      reference to Form_pg_appendonly to RelationData. With this separation,
      we can avoid pulling in a lot of other headers into rel.h, and avoid a
      circular dependency,
      d6748dd6
    • H
      Backport patch to reduce alignment of "name" from int to char. · e8b34fd4
      Heikki Linnakangas 提交于
      In the previous coding, if a "name" field in a struct, that was used for
      direct access to a catalog tuple, i.e. Form_pg_*, was not accidentally
      aligned to 4-byte boundary, the struct would not match what's stored on
      disk. I was bit by this, when I tried changing the compresstype field
      in pg_appendonly from text to name.
      
      This seems like a good idea from an upgrade point of view too. This change
      broke pg_upgrade for any tables that use the name datatype. That's not
      a big deal, because it shouldn't be used in user tables at all anyway, but
      might as well take the hit in 5.0 when the upgrade is expected to be more
      painful anyway.
      
      Original commit:
      
      commit 5f6f840e
      Author: Tom Lane <tgl@sss.pgh.pa.us>
      Date:   Tue Jun 24 17:58:27 2008 +0000
      
          Reduce the alignment requirement of type "name" from int to char, and arrange
          to suppress zero-padding of "name" entries in indexes.
      
          The alignment change is unlikely to save any space, but it is really needed
          anyway to make the world safe for our widespread practice of passing plain
          old C strings to functions that are declared as taking Name.  In the previous
          coding, the C compiler was entitled to assume that a Name pointer was
          word-aligned; but we were failing to guarantee that.  I think the reason
          we'd not seen failures is that usually the only thing that gets done with
          such a pointer is strcmp(), which is hard to optimize in a way that exploits
          word-alignment.  Still, some enterprising compiler guy will probably think
          of a way eventually, or we might change our code in a way that exposes
          more-obvious optimization opportunities.
      
          The padding change is accomplished in one-liner fashion by declaring the
          "name" index opclasses to use storage type "cstring" in pg_opclass.h.
          Normally btree and hash don't allow a nondefault storage type, because they
          don't have any provisions for converting the input datum to another type.
          However, because name and cstring are effectively the same thing except for
          padding, no conversion is needed --- we only need index_form_tuple() to treat
          the datum as being cstring not name, and this is sufficient.  This seems to
          make for about a one-third reduction in the typical sizes of system catalog
          indexes that involve "name" columns, of which we have many.
      
          These two changes are only weakly related, but the alignment change makes
          me feel safer that the padding change won't introduce problems, so I'm
          committing them together.
      e8b34fd4
    • H
      Remove unused argument. · b03bce78
      Heikki Linnakangas 提交于
      b03bce78
    • H
      Remove obsolete relaosegrelid and relaosegidxid fields from pg_class. · 9e1e324d
      Heikki Linnakangas 提交于
      They were not used for anything. Look at segrelid and segidxid in
      pg_appendonly instead.
      9e1e324d
    • H
      Pass relation name to ReadBuffer(), for error messages. · fc25fbcf
      Heikki Linnakangas 提交于
      Spotted while debugging a buggy patch of mine, that the relation names
      in the ReadBuffer() error messages currently come out as "(null)". Would
      segfault on with a different libc implementation.
      fc25fbcf
    • J
      Fix inconsistent trigger OIDs between master and segments. · 42534374
      Jimmy Yih 提交于
      Running gpcheckcat after constraints installcheck test shows trigger metadata
      inconsistencies between the master and segments. This issue was introduced
      in the 8.3 merge. If CreateTrigger Statement has a trigger oid already, we
      should reuse it like before the 8.3 merge.
      42534374
    • H
      Remove dead code. · 5fadbb87
      Heikki Linnakangas 提交于
      5fadbb87
    • H
      Merge JSON support from PostgreSQL 9.2. · fdfb6871
      Heikki Linnakangas 提交于
      This patch series adds the JSON datatype, with all the fixes that went
      into PostgreSQL 9.2 after the initial commit. See individual commits for
      more details.
      
      Author: Álvaro Hernández Tortosa <aht@8kdata.com>
      Reviewed-by: Daniel Gustafsson
      Reviewed-by: Andreas Scherbaum
      fdfb6871
  5. 01 8月, 2016 1 次提交
  6. 29 7月, 2016 2 次提交
  7. 28 7月, 2016 1 次提交