1. 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
  2. 03 8月, 2016 13 次提交
  3. 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
  4. 01 8月, 2016 1 次提交
  5. 29 7月, 2016 2 次提交
  6. 28 7月, 2016 3 次提交
    • K
    • H
      Add missing 'consttypmod' field to outfast/readfast functions. · 63d5743a
      Heikki Linnakangas 提交于
      This field was added to Const struct and the text out/read functions in
      PostgreSQL 8.3 (upstream commit 0f4ff460). In the merge, we missed that
      it also needs to be handled in the "fast" out/read functions.
      
      I wasn't able to come up with a test case that would misbehave because of
      this. When a Const is dispatched from the master to segments, the typmod
      has already been "applied" to the value, e.g. a numeric has been rounded
      to the desired precision. So it doesn't matter that the typmod is not
      available in the segments. However, gpcheckcat complained about the
      mismatch, in index expressions stored between the master and segments, as
      well as in atttypmod stored for a view. And if we leave the typmod
      uninitialized, it's left to 0, rather than -1 which would mean "no typmod",
      so clearly this must be fixed, even if it doesn't have any user-visible
      effects at the moment.
      
      Reported by Jimmy.
      63d5743a
    • A
      Fixing the issue with low speed of passing arrays containing nulls into PL/Python functions · e8cf3855
      Alexey Grishchenko 提交于
      Original implementation used array_ref for each element of the array. In case if array
      contains nulls, each call to the function array_ref causes a cycle over nulls bitmap to
      calculate the data offset. For array with 100'000 elements this causes 350x lower performance
      This fix uses the code from array_out for effective array data traversal
      e8cf3855