1. 29 9月, 2018 2 次提交
    • P
      MPP-ify AlterTableSpaceOptions. (#5878) · 5b508229
      Paul Guo 提交于
      Currently upstream supports two options: seq_page_cost and random_page_cost. In theory we possibly do not need to mpp-ify this utility stmt, but it is better to do that in case upstream or greenplum add some other option that affects QE.
      5b508229
    • P
      Use WITH syntax for options in create tablespace. (#5877) · e92a82d0
      Paul Guo 提交于
      PG9.4 starts to allow the WITH syntax to support options
      in create tablespace. Greenplum previously used the OPTIONS
      syntax to support per segment location. Let's union them all to
      use the WITH syntax only, following upstream.
      
      Note the greenplum specific OPTIONS exists in gpdb master only.
      e92a82d0
  2. 06 6月, 2018 1 次提交
    • A
      Optimize and correct copy_append_only_data(). · b3aff72d
      Ashwin Agrawal 提交于
      Alter tablespace needs to copy all underlying files of table from one tablespace
      to other. For AO/CO tables this was implemented using full directory scan to
      find files and copy when persistent tables were removed. This gets very
      inefficient and varies in performance based on number of files present in the
      directory. Instead use the same optimization logic used for `mdunlink_ao()`
      leveraging known file layout for AO/CO tables.
      
      Also, old logic had couple of bugs:
      - missed coping the base or .0 file. Which means data loss if table was altered in past.
      - xlogging even for temp tables
      
      These are fixed as well with this patch. Additional tests added to cover for
      those missing scenaiors. Also, moved the AO specific code to aomd.c, out of
      tablecmds.c file to reduce conflicts to upstream.
      b3aff72d
  3. 30 3月, 2018 2 次提交
    • J
      Add gp_tablespace_location wrapper function · 160a0eed
      Jimmy Yih 提交于
      The pg_tablespace_location function only returns the tablespace
      location of the connected segment. For Greenplum, we need to be able
      to easily see the tablespace locations for all segments. This is
      especially needed because we support defining tablespace locations
      per-segment.
      160a0eed
    • D
      Support per-segment tablespace location definitions · 451934d5
      Daniel Gustafsson 提交于
      The old filespace concept allowed for different physical location per
      segment/mirror, whereas the tablespace definition only support a
      single location.  Tablespaces are backed by a symlink which can be
      changed without any changes required on the database level, as long as
      the system is turned off at the time. To recreate the filespace
      functionality, a process like this would be required:
      
        1. CREATE TABLESPACE foo LOCATION '/foo/bar';
        2. Shut down the cluster
        3. Move the symlinks to preferred location on each segment
        4. Start cluster back up
      
      Since step 3 require accessing each segment in the cluster, it is
      preferable to allow syntax do to this automatically. This commit adds
      support for specifying per segment overrides from the default LOCATION
      by using an optional OPTIONS clause to specify the segment's content
      ID and desired non-default location:
      
        CREATE TABLESPACE foo LOCATION '/foo/bar'
          OPTIONS (content1 '/content1/bar', content2 '/content2/bar');
      
      Any segment content ID not listed in the OPTIONS clause will get the
      LOCATION as its tablespace symlink. The spclocation will be set to
      LOCATION, but that column will shortly go away as it's no longer used.
      
      Greenplum Developers mailing thread:
      https://groups.google.com/a/greenplum.org/forum/#!msg/gpdb-dev/vmdRjm54on8/nj2SSns0AwAJCo-authored-by: NJimmy Yih <jyih@pivotal.io>
      451934d5
  4. 13 1月, 2018 1 次提交