提交 4c8c8e23 编写于 作者: A Ashwin Agrawal

TINC: Delete pg_twophase test and CI job.

Decent coverage exist for 2PC in isolation2, plus coverage will be enhanced. The
current tests in TINC for pg_twophase are written specifically for filerep. That
much extensive tests to create all types of objects and all is not required for
walrep given the fact it relies on crash recovery logic for replication. Either
these tests need to be modified to continue to work for walrep, instead better
to delete them and write fresh ones as required for walrep and 2PC interaction
in isolation2.
上级 f06498cf
......@@ -12,7 +12,7 @@
## file (example: templates/gpdb-tpl.yml) and regenerate the pipeline
## using appropriate tool (example: gen_pipeline.py -t prod).
## ----------------------------------------------------------------------
## Generated by gen_pipeline.py at: 2018-04-19 11:39:19.606218
## Generated by gen_pipeline.py at: 2018-04-25 12:07:49.938407
## Template file: gpdb-tpl.yml
## OS Types: ['centos6', 'centos7', 'sles', 'aix7', 'win', 'ubuntu16']
## Test Sections: ['ICW', 'Replication', 'ResourceGroups', 'Interconnect', 'CLI', 'UD']
......@@ -58,7 +58,6 @@ groups:
- gate_replication_start
- walrep_1
- walrep_2
- pg_twophase
- segwalrep_mirrorless_centos6
## --------------------------------------------------------------------
- interconnect
......@@ -146,7 +145,6 @@ groups:
- gate_replication_start
- walrep_1
- walrep_2
- pg_twophase
- segwalrep_mirrorless_centos6
- compile_gpdb_centos6
......@@ -1314,40 +1312,6 @@ jobs:
ensure:
<<: *set_failed
- name: pg_twophase
plan:
- aggregate:
- get: gpdb_src
passed: [gate_replication_start]
- get: gpdb_binary
resource: bin_gpdb_centos6
passed: [gate_replication_start]
trigger: true
- get: ccp_src
- get: centos-gpdb-dev-6
- put: terraform
params:
<<: *ccp_default_params
vars:
<<: *ccp_default_vars
aws_instance-node-instance_type: m4.large
aws_ebs_volume_type: gp2
number_of_nodes: 1
- task: gen_cluster
file: ccp_src/ci/tasks/gen_cluster.yml
params:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml
- task: run_tests
file: gpdb_src/concourse/tasks/run_tinc.yml
image: centos-gpdb-dev-6
params:
TINC_TARGET: test_pg_twophase
on_success:
<<: *ccp_destroy
ensure:
<<: *set_failed
- name: segwalrep_mirrorless_centos6
plan:
......@@ -2141,7 +2105,6 @@ jobs:
- segwalrep_mirrorless_centos6
- walrep_1
- walrep_2
- pg_twophase
- QP_memory-accounting
- regression_tests_gphdfs_centos
- regression_tests_pxf
......
......@@ -76,7 +76,6 @@ groups:
- gate_replication_start
- walrep_1
- walrep_2
- pg_twophase
- segwalrep_mirrorless_centos6
{% endif %}
{% if "Interconnect" in test_sections %}
......@@ -203,7 +202,6 @@ groups:
- gate_replication_start
- walrep_1
- walrep_2
- pg_twophase
- segwalrep_mirrorless_centos6
- compile_gpdb_centos6
......@@ -1447,40 +1445,6 @@ jobs:
<<: *set_failed
{% endfor %}
- name: pg_twophase
plan:
- aggregate:
- get: gpdb_src
passed: [gate_replication_start]
- get: gpdb_binary
resource: bin_gpdb_centos6
passed: [gate_replication_start]
trigger: [[ test_trigger ]]
- get: ccp_src
- get: centos-gpdb-dev-6
- put: terraform
params:
<<: *ccp_default_params
vars:
<<: *ccp_default_vars
aws_instance-node-instance_type: m4.large
aws_ebs_volume_type: gp2
number_of_nodes: 1
- task: gen_cluster
file: ccp_src/ci/tasks/gen_cluster.yml
params:
<<: *ccp_gen_cluster_default_params
- task: gpinitsystem
file: ccp_src/ci/tasks/gpinitsystem.yml
- task: run_tests
file: gpdb_src/concourse/tasks/run_tinc.yml
image: centos-gpdb-dev-6
params:
TINC_TARGET: test_pg_twophase
on_success:
<<: *ccp_destroy
ensure:
<<: *set_failed
- name: segwalrep_mirrorless_centos6
plan:
......@@ -2199,7 +2163,6 @@ jobs:
- segwalrep_mirrorless_centos6
- walrep_1
- walrep_2
- pg_twophase
- QP_memory-accounting
- regression_tests_gphdfs_centos
- regression_tests_pxf
......
......@@ -58,12 +58,6 @@ walrep_2:
-q "class!=DDLTestCase" \
-q "class!=DMLTestCase"
test_pg_twophase:
$(TESTER) $(DISCOVER) \
-s tincrepo/mpp/gpdb/tests/storage/pg_twophase \
-p test_pg_twophase.py \
-p test_switch.py
runaway_query:
$(TESTER) \
resource_management.runaway_query.runaway_query_scenario.test_runaway_query_scenario.RQTScenarioTestCase \
......
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import os
import glob
from time import sleep
import tinctest
from tinctest.lib import local_path
from gppylib.commands.base import Command
from mpp.lib.PSQL import PSQL
from mpp.lib.filerep_util import Filerepe2e_Util
from mpp.lib.gprecoverseg import GpRecover
from mpp.lib.gpstart import GpStart
from mpp.lib.gpstop import GpStop
from mpp.lib.config import GPDBConfig
from mpp.lib.gpdbverify import GpdbVerify
from mpp.models import MPPTestCase
from mpp.gpdb.tests.storage.lib.dbstate import DbStateClass
from mpp.gpdb.tests.storage.lib.common_utils import *
class PgtwoPhaseClass(MPPTestCase):
'''Helper class for pg_twophase supporting functions '''
def __init__(self,methodName):
self.filereputil = Filerepe2e_Util()
self.config = GPDBConfig()
self.gprecover = GpRecover(self.config)
self.gpstop = GpStop()
self.gpstart = GpStart()
self.gpverify = GpdbVerify(config=self.config)
self.dbstate = DbStateClass('run_validation',self.config)
self.port = os.getenv('PGPORT')
super(PgtwoPhaseClass,self).__init__(methodName)
def invoke_fault(self, fault_name, type, role='mirror', occurence=0, sleeptime=0, seg_id=None):
''' Reset the fault and then issue the fault with the given type'''
self.filereputil.inject_fault(f=fault_name, y='reset', r=role, o=occurence, sleeptime=sleeptime, seg_id=seg_id)
self.filereputil.inject_fault(f=fault_name, y=type, r=role, o=occurence, sleeptime=sleeptime, seg_id=seg_id)
tinctest.logger.info('Successfully injected fault_name : %s fault_type : %s' % (fault_name, type))
def inject_fault(self, fault_type):
'''
@param fault_type : type of fault to ne suspended
'''
if fault_type == 'end_prepare_two_phase_sleep':
self.filereputil.inject_fault(f='end_prepare_two_phase_sleep', sleeptime='1000', y='sleep', r='primary')
tinctest.logger.info('Injected fault to sleep in end_prepare_two_phase')
elif fault_type == 'abort':
# In case of abort fault we need to include this error type fault also, to fake a situation where one of the segment is not responding back, which can make the master to trigger an abort transaction
self.invoke_fault('transaction_abort_after_distributed_prepared', 'error', occurence='0', seg_id='1')
self.invoke_fault('twophase_transaction_abort_prepared', 'suspend', role='primary', occurence='0')
elif fault_type == 'commit':
self.invoke_fault('twophase_transaction_commit_prepared', 'suspend', role='primary', occurence='0')
elif fault_type == 'dtm_broadcast_prepare':
self.invoke_fault('dtm_broadcast_prepare', 'suspend', seg_id = '1', occurence='0')
elif fault_type == 'dtm_broadcast_commit_prepared':
self.invoke_fault('dtm_broadcast_commit_prepared', 'suspend', seg_id = '1', occurence='0')
elif fault_type == 'dtm_xlog_distributed_commit':
self.invoke_fault('dtm_xlog_distributed_commit', 'suspend', seg_id = '1', occurence='0')
def resume_faults(self, fault_type, cluster_state='sync'):
'''
@param fault_type : commit/abort/end_prepare_two_phase_sleep/dtm_broadcast_prepare/dtm_broadcast_commit_prepared/dtm_xlog_distributed_commit
@description : Resume the suspended faults
'''
tinctest.logger.info('coming to resume faults with xact %s' % fault_type)
if fault_type == 'abort':
self.filereputil.inject_fault(f='twophase_transaction_abort_prepared', y='resume', r='primary', o='0')
if cluster_state !='resync':
self.filereputil.inject_fault(f='transaction_abort_after_distributed_prepared', y='reset', o='0', seg_id='1')
elif fault_type == 'commit':
self.filereputil.inject_fault(f='twophase_transaction_commit_prepared', y='resume', r='primary', o='0')
elif fault_type == 'dtm_broadcast_prepare':
self.filereputil.inject_fault(f='dtm_broadcast_prepare', y='resume', seg_id = '1', o='0')
elif fault_type == 'dtm_broadcast_commit_prepared':
tinctest.logger.info('coming to if dtm_broadcast_commit_prepared')
self.filereputil.inject_fault(f='dtm_broadcast_commit_prepared', y='resume', seg_id = '1', o='0')
elif fault_type == 'dtm_xlog_distributed_commit':
self.filereputil.inject_fault(f='dtm_xlog_distributed_commit', y='resume', seg_id = '1', o='0')
else:
tinctest.logger.info('No faults to resume')
tinctest.logger.info('Resumed the suspended transaction fault')
#Wait till all the trigger_sqls are complete before returning
sql_count = PSQL.run_sql_command('select count(*) from pg_stat_activity;', flags ='-q -t', dbname='postgres')
while(sql_count.strip() != '1'):
sleep(5)
sql_count = PSQL.run_sql_command('select count(*) from pg_stat_activity;', flags ='-q -t', dbname='postgres')
tinctest.logger.info('stat_activity count %s ' % sql_count)
return
def start_db(self):
'''Gpstart '''
rc = self.gpstart.run_gpstart_cmd()
if not rc:
raise Exception('Failed to start the cluster')
tinctest.logger.info('Started the cluster successfully')
def stop_db(self):
''' Gpstop and dont check for rc '''
cmd = Command('Gpstop_a', 'gpstop -a')
tinctest.logger.info('Executing command: gpstop -a')
cmd.run()
def crash_and_recover(self, crash_type, fault_type, checkpoint='noskip', cluster_state='sync'):
'''
@param crash_type : gpstop_i/gpstop_a/failover_to_primary/failover_to_mirror
@note: when skip checkpoint is enabled, gpstop -a returns a non-rc return code and fails in the library. To workaround, using a local function
'''
if crash_type == 'gpstop_i' :
rc = self.gpstop.run_gpstop_cmd(immediate = True)
if not rc:
raise Exception('Failed to stop the cluster')
tinctest.logger.info('Stopped cluster immediately')
self.start_db()
elif crash_type == 'gpstop_a':
self.resume_faults(fault_type, cluster_state)
if checkpoint == 'skip' :
self.stop_db()
else:
rc = self.gpstop.run_gpstop_cmd()
if not rc:
raise Exception('Failed to stop the cluster')
tinctest.logger.info('Smart stop completed')
self.start_db()
elif crash_type == 'failover_to_primary':
self.invoke_fault('filerep_consumer', 'fault')
self.resume_faults(fault_type, cluster_state)
(rc, num) =self.filereputil.wait_till_change_tracking_transition()
tinctest.logger.info('Value of rc and num_down %s, %s, %s' % (rc, num, fault_type))
elif crash_type == 'failover_to_mirror':
self.invoke_fault('postmaster', 'panic', role='primary')
if fault_type in ('dtm_broadcast_prepare', 'dtm_broadcast_commit_prepared', 'dtm_xlog_distributed_commit') :
self.resume_faults(fault_type, cluster_state)
PSQL.wait_for_database_up()
(rc, num) = self.filereputil.wait_till_change_tracking_transition()
tinctest.logger.info('Value of rc and num_down %s, %s' % (rc, num))
if fault_type == 'abort' :
self.filereputil.inject_fault(f='transaction_abort_after_distributed_prepared', y='reset', o='0', seg_id='1')
if cluster_state == 'resync':
if not self.gprecover.wait_till_insync_transition():
raise Exception('Segments not in sync')
def get_trigger_status_old(self, trigger_count):
'''Compare the pg_stat_activity count with the total number of trigger_sqls executed '''
for i in range(1,50):
psql_count = PSQL.run_sql_command('select count(*) from pg_stat_activity;', flags='-q -t', dbname='postgres')
tinctest.logger.info('Count of trigger sqls %s' % psql_count)
if int(psql_count.strip()) < trigger_count :
tinctest.logger.info('coming to the if loop in get_trigger_status')
return False
return True
def get_trigger_status(self, trigger_count, fault_type):
if fault_type == None:
return self.get_trigger_status_old(trigger_count);
return self.filereputil.check_fault_status(fault_name=fault_type, status="triggered", seg_id='1', num_times_hit=trigger_count);
def check_trigger_sql_hang(self, test_dir, fault_type = None):
'''
@description : Return the status of the trigger sqls: whether they are waiting on the fault
Since gpfaultinjector has no way to check if all the sqls are triggered, we are using
a count(*) on pg_stat_activity and compare the total number of trigger_sqls
'''
trigger_count=0
for dir in test_dir.split(","):
trigger_dir = local_path('%s/trigger_sql/sql/' % (dir))
trigger_count += len(glob.glob1(trigger_dir,"*.sql"))
tinctest.logger.info('Total number of sqls to trigger %d in %s' % (trigger_count,test_dir));
return self.get_trigger_status(trigger_count, fault_type)
def run_faults_before_pre(self, cluster_state):
'''
@param cluster_state : sync/change_tracking/resync
@description: 1. Cluster into change_tracking in case of resync/ change_tracking.
'''
if cluster_state == 'resync':
self.invoke_fault('filerep_consumer', 'fault')
self.filereputil.wait_till_change_tracking_transition()
tinctest.logger.info('Change_tracking transition complete')
def run_faults_before_trigger(self, checkpoint, cluster_state, fault_type):
'''
@param checkpoint : skip/noskip
@param cluster_state : sync/change_tracking/resync
@param fault_type : commit/abort
@param end_prepare_two_phase_sleep : True/False
@description : 1. Suspend resync faults. 2. Issue Checkpoint before the skip checkpoint, so that the bufferpool is cleared. 3. If skip issue 'skip checkpoint'. 4. Suspend transaction_faults based on test_type.
'''
if cluster_state == 'change_tracking':
self.invoke_fault('filerep_consumer', 'fault')
self.filereputil.wait_till_change_tracking_transition()
tinctest.logger.info('Change_tracking transition complete')
if cluster_state == 'resync':
self.invoke_fault('filerep_resync', 'suspend', role='primary')
if checkpoint == 'skip':
self.invoke_fault('filerep_transition_to_sync_before_checkpoint', 'suspend', role='primary', occurence='0')
rc = self.gprecover.incremental()
if not rc:
raise Exception('Gprecvoerseg failed')
tinctest.logger.info('Cluster in resync state')
PSQL.run_sql_command('CHECKPOINT;', dbname='postgres')
if checkpoint == 'skip':
self.invoke_fault('checkpoint', 'skip', role='primary', occurence='0')
self.inject_fault(fault_type)
# Can't do it after filerep_resync resume as gets stuck due to
# filerep_transition_to_sync_before_checkpoint suspend above for
# MirroedLock
PSQL.wait_for_database_up()
if cluster_state == 'resync':
self.filereputil.inject_fault(f='filerep_resync', y='resume', r='primary')
def run_crash_and_recover(self, crash_type, fault_type, test_dir, cluster_state='sync', checkpoint='noskip'):
'''
@param crash_type : gpstop_i/gpstop_a/failover_to_mirror/failover_to_primary
@param fault_type : commit/abort/end_prepare_two_phase_sleep
@param test_dir : dir of the trigger sqls
@description : Execute the specified crash type before/after resuming the suspended fault and recover
'''
trigger_status = self.check_trigger_sql_hang(test_dir)
tinctest.logger.info('trigger_status %s' % trigger_status)
sleep(50) # This sleep is needed till we get a way to find the state of all suspended sqls
if trigger_status == True:
if cluster_state == 'resync':
self.filereputil.inject_fault(f='filerep_transition_to_sync_before_checkpoint', y='resume', r='primary')
sleep(15) # wait little before crash
self.crash_and_recover(crash_type, fault_type, checkpoint, cluster_state)
else:
tinctest.logger.info('The fault_status is not triggered')
def gprecover_rebalance(self):
'''
@description: Run rebalance through gpstop -air is much faster than gprecoverseg -r for test purpose.
'''
rc = self.gpstop.run_gpstop_cmd(immediate = True)
if not rc:
raise Exception('Failed to stop the cluster')
tinctest.logger.info('Stopped cluster immediately')
self.start_db()
def run_gprecover(self, crash_type, cluster_state='sync'):
'''Recover the cluster if required. '''
if crash_type in ('failover_to_primary', 'failover_to_mirror') or cluster_state == 'change_tracking' :
rc = self.gprecover.incremental()
if not rc:
raise Exception('Gprecvoerseg failed')
if not self.gprecover.wait_till_insync_transition():
raise Exception('Segments not in sync')
tinctest.logger.info('Cluster in sync state')
if crash_type == 'failover_to_mirror' :
self.gprecover_rebalance()
tinctest.logger.info('Successfully Rebalanced the cluster')
else:
tinctest.logger.info('No need to run gprecoverseg. The cluster should be already in sync')
def switch_ckpt_faults_before_trigger(self, cluster_state, fault_type):
'''
@param cluster_state : sync/change_tracking/resync
@param fault_type : dtm_broadcast_prepare/dtm_broadcast_commit_prepared/dtm_xlog_distributed_commit
'''
if cluster_state in ('change_tracking', 'resync'):
self.invoke_fault('filerep_consumer', 'fault')
self.filereputil.wait_till_change_tracking_transition()
tinctest.logger.info('Change_tracking transition complete')
if cluster_state == 'resync':
self.invoke_fault('filerep_resync', 'suspend', role='primary')
rc = self.gprecover.incremental()
if not rc:
raise Exception('Gprecvoerseg failed')
tinctest.logger.info('Cluster in resync state')
self.inject_fault(fault_type)
def switch_ckpt_switch_xlog(self):
'''
@description: pg_switch_xlog on segments
'''
sql_cmd = 'select * from pg_switch_xlog();'
num_primary = self.config.get_countprimarysegments()
for i in range(num_primary):
(host, port) = self.config.get_hostandport_of_segment(psegmentNumber=i)
PSQL.run_sql_command_utility_mode(sql_cmd, host = host, port = port)
def switch_ckpt_crash_and_recover(self, crash_type, fault_type, test_dir, cluster_state='sync', checkpoint='noskip'):
'''
@param crash_type : gpstop_i/gpstop_a/failover_to_mirror/failover_to_primary
@param fault_type : dtm_broadcast_prepare/dtm_broadcast_commit_prepared/dtm_xlog_distributed_commit
@param test_dir : dir of the trigger_sqls
'''
trigger_status = self.check_trigger_sql_hang(test_dir, fault_type)
tinctest.logger.info('trigger_status %s' % trigger_status)
if trigger_status == True:
if cluster_state == 'resync':
self.filereputil.inject_fault(f='filerep_resync', y='resume', r='primary')
sleep(30) #Give a little time before crash.
self.crash_and_recover(crash_type, fault_type, checkpoint, cluster_state)
else:
tinctest.logger.info('The fault_status is not triggered')
def cleanup_dangling_processes(self):
'''
@description: Since the test suspend transactions at different stages and does immediate shutdown,
few processes will not be cleaned up and eventually will eat up on the system resources
This methods takes care of killing them at the end of each test, if such processes exists
'''
num_primary = self.config.get_countprimarysegments()
for i in range(num_primary):
(host, port) = self.config.get_hostandport_of_segment(psegmentNumber=i)
grep_cmd = "ps -ef|grep %s|grep 'Distributed'" % port
cmd = Command('Check for dangling process', cmdStr = 'gpssh -h %s -e "%s" ' % (host, grep_cmd))
cmd.run()
result = cmd.get_results()
if len(result.stdout.splitlines()) > 2 :
grep_and_kill_cmd = "ps -ef|grep %s|grep 'Distributed'|awk '{print \$2}'|xargs kill -9" % port
cmd = Command('Kill dangling processes', cmdStr='gpssh -h %s -e "%s" ' % (host, grep_and_kill_cmd ))
cmd.run()
tinctest.logger.info('Killing the dangling processes')
alter table ao_table_for_alter set tablespace twophase_test_ts2;
ALTER TABLE
\d ao_table_for_alter
Append-Only Table "public.ao_table_for_alter"
Column | Type | Modifiers
--------+-----------------------------+----------------------------------------------
phase | text |
a | integer |
col001 | character(1) | default 'z'::bpchar
col002 | numeric |
col003 | boolean | default false
col004 | bit(3) | default B'111'::"bit"
col005 | text | default 'pookie'::text
col006 | integer[] | default '{5,4,3,2,1}'::integer[]
col007 | character varying(512) | default 'Now is the time'::character varying
col008 | character varying | default 'Now is the time'::character varying
col009 | character varying(512)[] |
col010 | numeric(8,0) |
col011 | integer |
col012 | double precision |
col013 | bigint |
col014 | character(8) |
col015 | bytea |
col016 | timestamp with time zone |
col017 | interval |
col018 | cidr |
col019 | inet |
col020 | macaddr |
col022 | money |
col024 | time with time zone |
col025 | circle |
col026 | box |
col027 | name |
col028 | path |
col029 | smallint |
col031 | bit varying(256) |
col032 | date |
col034 | lseg |
col035 | point |
col036 | polygon |
col037 | real |
col039 | time without time zone |
col040 | timestamp without time zone |
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Distributed by: (phase)
Tablespace: "twophase_test_ts2"
INSERT INTO ao_table_for_alter VALUES ('sync1_ao1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 10
DROP table ao_table_for_alter;
DROP TABLE
alter table co_table_for_alter set tablespace twophase_test_ts2;
ALTER TABLE
\d co_table_for_alter
Append-Only Columnar Table "public.co_table_for_alter"
Column | Type | Modifiers
--------+-----------------------------+----------------------------------------------
phase | text |
a | integer |
col001 | character(1) | default 'z'::bpchar
col002 | numeric |
col003 | boolean | default false
col004 | bit(3) | default B'111'::"bit"
col005 | text | default 'pookie'::text
col006 | integer[] | default '{5,4,3,2,1}'::integer[]
col007 | character varying(512) | default 'Now is the time'::character varying
col008 | character varying | default 'Now is the time'::character varying
col009 | character varying(512)[] |
col010 | numeric(8,0) |
col011 | integer |
col012 | double precision |
col013 | bigint |
col014 | character(8) |
col015 | bytea |
col016 | timestamp with time zone |
col017 | interval |
col018 | cidr |
col019 | inet |
col020 | macaddr |
col022 | money |
col024 | time with time zone |
col025 | circle |
col026 | box |
col027 | name |
col028 | path |
col029 | smallint |
col031 | bit varying(256) |
col032 | date |
col034 | lseg |
col035 | point |
col036 | polygon |
col037 | real |
col039 | time without time zone |
col040 | timestamp without time zone |
Checksum: f
Distributed by: (phase)
Tablespace: "twophase_test_ts2"
INSERT INTO co_table_for_alter VALUES ('sync1_co1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 10
DROP table co_table_for_alter;
DROP TABLE
alter table heap_table_for_alter set tablespace twophase_test_ts2;
ALTER TABLE
\d heap_table_for_alter
Table "public.heap_table_for_alter"
Column | Type | Modifiers
--------+-----------------------------+----------------------------------------------
phase | text |
a | integer |
col001 | character(1) | default 'z'::bpchar
col002 | numeric |
col003 | boolean | default false
col004 | bit(3) | default B'111'::"bit"
col005 | text | default 'pookie'::text
col006 | integer[] | default '{5,4,3,2,1}'::integer[]
col007 | character varying(512) | default 'Now is the time'::character varying
col008 | character varying | default 'Now is the time'::character varying
col009 | character varying(512)[] |
col010 | numeric(8,0) |
col011 | integer |
col012 | double precision |
col013 | bigint |
col014 | character(8) |
col015 | bytea |
col016 | timestamp with time zone |
col017 | interval |
col018 | cidr |
col019 | inet |
col020 | macaddr |
col022 | money |
col024 | time with time zone |
col025 | circle |
col026 | box |
col027 | name |
col028 | path |
col029 | smallint |
col031 | bit varying(256) |
col032 | date |
col034 | lseg |
col035 | point |
col036 | polygon |
col037 | real |
col039 | time without time zone |
col040 | timestamp without time zone |
Distributed by: (phase)
Tablespace: "twophase_test_ts2"
INSERT INTO heap_table_for_alter VALUES ('sync1_heap1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 10
DROP table heap_table_for_alter;
DROP TABLE
CREATE INDEX cr_ao_bitmap_idx1 ON cr_ao_table_bitmap_index USING bitmap (numeric_col);
CREATE INDEX
\d cr_ao_table_bitmap_index
Append-Only Table "public.cr_ao_table_bitmap_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Indexes:
"cr_ao_bitmap_idx1" bitmap (numeric_col)
Distributed by: (text_col)
insert into cr_ao_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_ao_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_ao_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_ao_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
set enable_seqscan=off;
SET
select numeric_col from cr_ao_table_bitmap_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_ao_table_bitmap_index;
DROP TABLE
CREATE INDEX cr_ao_btree_idx1 ON cr_ao_table_btree_index (numeric_col);
CREATE INDEX
\d cr_ao_table_btree_index
Append-Only Table "public.cr_ao_table_btree_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Indexes:
"cr_ao_btree_idx1" btree (numeric_col)
Distributed by: (text_col)
insert into cr_ao_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_ao_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_ao_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_ao_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
set enable_seqscan=off;
SET
select numeric_col from cr_ao_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_ao_table_btree_index;
DROP TABLE
CREATE INDEX cr_ao_gist_idx1 ON cr_ao_table_gist_index USING GiST (property);
CREATE INDEX
\d cr_ao_table_gist_index
Append-Only Table "public.cr_ao_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Indexes:
"cr_ao_gist_idx1" gist (property)
Distributed by: (id)
set enable_seqscan=off;
SET
select property from cr_ao_table_gist_index where property='( (0,0), (1,1) )';
property
-------------
(1,1),(0,0)
(1 row)
DROP TABLE cr_ao_table_gist_index;
DROP TABLE
CREATE TABLE cr_ao_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) with (appendonly = true);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
INSERT INTO cr_ao_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 1
DROP TABLE cr_ao_table;
DROP TABLE
CREATE TABLE ao_jit_table( phase text,a int,aol001 char DEFAULT 'z',aol002 numeric,aol003 boolean DEFAULT false,aol004 bit(3) DEFAULT '111',
aol005 text DEFAULT 'pookie', aol006 integer[] DEFAULT '{5, 4, 3, 2, 1}', aol007 character varying(512) DEFAULT 'Now is the time', aol008 character varying DEFAULT 'Now is the time',
aol009 character varying(512)[], aol010 numeric(8),aol011 int,aol012 double precision, aol013 bigint, aol014 char(8), aol015 bytea,aol016 timestamp with time zone,aol017 interval,
aol018 cidr, aol019 inet, aol020 macaddr,aol022 money, aol024 timetz,aol025 circle, aol026 box, aol027 name,aol028 path, aol029 int2, aol031 bit varying(256),
aol032 date, aol034 lseg,aol035 point,aol036 polygon,aol037 real,aol039 time, aol040 timestamp ) WITH (appendonly=true) tablespace twophase_test_ts ;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
\d ao_jit_table
Append-Only Table "public.ao_jit_table"
Column | Type | Modifiers
--------+-----------------------------+----------------------------------------------
phase | text |
a | integer |
aol001 | character(1) | default 'z'::bpchar
aol002 | numeric |
aol003 | boolean | default false
aol004 | bit(3) | default B'111'::"bit"
aol005 | text | default 'pookie'::text
aol006 | integer[] | default '{5,4,3,2,1}'::integer[]
aol007 | character varying(512) | default 'Now is the time'::character varying
aol008 | character varying | default 'Now is the time'::character varying
aol009 | character varying(512)[] |
aol010 | numeric(8,0) |
aol011 | integer |
aol012 | double precision |
aol013 | bigint |
aol014 | character(8) |
aol015 | bytea |
aol016 | timestamp with time zone |
aol017 | interval |
aol018 | cidr |
aol019 | inet |
aol020 | macaddr |
aol022 | money |
aol024 | time with time zone |
aol025 | circle |
aol026 | box |
aol027 | name |
aol028 | path |
aol029 | smallint |
aol031 | bit varying(256) |
aol032 | date |
aol034 | lseg |
aol035 | point |
aol036 | polygon |
aol037 | real |
aol039 | time without time zone |
aol040 | timestamp without time zone |
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Distributed by: (phase)
Tablespace: "twophase_test_ts"
INSERT INTO ao_jit_table VALUES ('sync1_ao1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 10
DROP table ao_jit_table;
DROP TABLE
REINDEX INDEX cr_ao_reindex_bitmap_idx1;
REINDEX
\d cr_ao_reindex_table_bitmap_index
Append-Only Table "public.cr_ao_reindex_table_bitmap_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Indexes:
"cr_ao_reindex_bitmap_idx1" bitmap (numeric_col)
Distributed by: (text_col)
insert into cr_ao_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
INSERT 0 10
SELECT COUNT(*) FROM cr_ao_reindex_table_bitmap_index;
count
-------
111
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_ao_reindex_table_bitmap_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_ao_reindex_table_bitmap_index;
DROP TABLE
REINDEX INDEX cr_ao_reindex_btree_idx1;
REINDEX
\d cr_ao_reindex_table_btree_index
Append-Only Table "public.cr_ao_reindex_table_btree_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Indexes:
"cr_ao_reindex_btree_idx1" btree (numeric_col)
Distributed by: (text_col)
insert into cr_ao_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
INSERT 0 10
SELECT COUNT(*) FROM cr_ao_reindex_table_btree_index;
count
-------
111
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_ao_reindex_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_ao_reindex_table_btree_index;
DROP TABLE
REINDEX INDEX cr_ao_reindex_gist_idx1;
REINDEX
\d cr_ao_reindex_table_gist_index
Append-Only Table "public.cr_ao_reindex_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Compression Type: None
Compression Level: 0
Block Size: 32768
Checksum: f
Indexes:
"cr_ao_reindex_gist_idx1" gist (property)
Distributed by: (id)
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
INSERT 0 1
SELECT COUNT(*) FROM cr_ao_reindex_table_gist_index;
count
-------
6
(1 row)
set enable_seqscan=off;
SET
select property from cr_ao_reindex_table_gist_index where property='( (0,0), (6,6) )';
property
-------------
(6,6),(0,0)
(1 row)
drop table cr_ao_reindex_table_gist_index;
DROP TABLE
TRUNCATE TABLE cr_ao_truncate_table;
TRUNCATE TABLE
SELECT COUNT(*) FROM cr_ao_truncate_table;
count
-------
0
(1 row)
DROP TABLE cr_ao_truncate_table;
DROP TABLE
CREATE INDEX cr_co_bitmap_idx1 ON cr_co_table_bitmap_index USING bitmap (numeric_col);
CREATE INDEX
\d cr_co_table_bitmap_index
Append-Only Columnar Table "public.cr_co_table_bitmap_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Checksum: f
Indexes:
"cr_co_bitmap_idx1" bitmap (numeric_col)
Distributed by: (text_col)
insert into cr_co_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_co_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_co_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_co_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
set enable_seqscan=off;
SET
select numeric_col from cr_co_table_bitmap_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_co_table_bitmap_index;
DROP TABLE
CREATE INDEX cr_co_btree_idx1 ON cr_co_table_btree_index (numeric_col);
CREATE INDEX
\d cr_co_table_btree_index
Append-Only Columnar Table "public.cr_co_table_btree_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Checksum: f
Indexes:
"cr_co_btree_idx1" btree (numeric_col)
Distributed by: (text_col)
insert into cr_co_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_co_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_co_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_co_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
set enable_seqscan=off;
SET
select numeric_col from cr_co_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_co_table_btree_index;
DROP TABLE
CREATE INDEX cr_co_gist_idx1 ON cr_co_table_gist_index USING GiST (property);
CREATE INDEX
\d cr_co_table_gist_index
Append-Only Columnar Table "public.cr_co_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Checksum: f
Indexes:
"cr_co_gist_idx1" gist (property)
Distributed by: (id)
set enable_seqscan=off;
SET
select property from cr_co_table_gist_index where property='( (0,0), (1,1) )';
property
-------------
(1,1),(0,0)
(1 row)
DROP TABLE cr_co_table_gist_index;
DROP TABLE
CREATE TABLE cr_co_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) with (appendonly = true, orientation = column);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
INSERT INTO cr_co_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 1
DROP TABLE cr_co_table;
DROP TABLE
CREATE TABLE co_jit_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) WITH (appendonly=true,orientation=column) tablespace twophase_test_ts ;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
\d co_jit_table
Append-Only Columnar Table "public.co_jit_table"
Column | Type | Modifiers
--------+-----------------------------+----------------------------------------------
phase | text |
a | integer |
col001 | character(1) | default 'z'::bpchar
col002 | numeric |
col003 | boolean | default false
col004 | bit(3) | default B'111'::"bit"
col005 | text | default 'pookie'::text
col006 | integer[] | default '{5,4,3,2,1}'::integer[]
col007 | character varying(512) | default 'Now is the time'::character varying
col008 | character varying | default 'Now is the time'::character varying
col009 | character varying(512)[] |
col010 | numeric(8,0) |
col011 | integer |
col012 | double precision |
col013 | bigint |
col014 | character(8) |
col015 | bytea |
col016 | timestamp with time zone |
col017 | interval |
col018 | cidr |
col019 | inet |
col020 | macaddr |
col022 | money |
col024 | time with time zone |
col025 | circle |
col026 | box |
col027 | name |
col028 | path |
col029 | smallint |
col031 | bit varying(256) |
col032 | date |
col034 | lseg |
col035 | point |
col036 | polygon |
col037 | real |
col039 | time without time zone |
col040 | timestamp without time zone |
Checksum: f
Distributed by: (phase)
Tablespace: "twophase_test_ts"
INSERT INTO co_jit_table VALUES ('sync1_co1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 10
DROP table co_jit_table;
DROP TABLE
REINDEX INDEX cr_co_reindex_bitmap_idx1;
REINDEX
\d cr_co_reindex_table_bitmap_index
Append-Only Columnar Table "public.cr_co_reindex_table_bitmap_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Checksum: f
Indexes:
"cr_co_reindex_bitmap_idx1" bitmap (numeric_col)
Distributed by: (text_col)
insert into cr_co_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
INSERT 0 10
SELECT COUNT(*) FROM cr_co_reindex_table_bitmap_index;
count
-------
111
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_co_reindex_table_bitmap_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_co_reindex_table_bitmap_index;
DROP TABLE
REINDEX INDEX cr_co_reindex_btree_idx1;
REINDEX
\d cr_co_reindex_table_btree_index
Append-Only Columnar Table "public.cr_co_reindex_table_btree_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Checksum: f
Indexes:
"cr_co_reindex_btree_idx1" btree (numeric_col)
Distributed by: (text_col)
insert into cr_co_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
INSERT 0 10
SELECT COUNT(*) FROM cr_co_reindex_table_btree_index;
count
-------
111
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_co_reindex_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_co_reindex_table_btree_index;
DROP TABLE
REINDEX INDEX cr_co_reindex_gist_idx1;
REINDEX
\d cr_co_reindex_table_gist_index
Append-Only Columnar Table "public.cr_co_reindex_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Checksum: f
Indexes:
"cr_co_reindex_gist_idx1" gist (property)
Distributed by: (id)
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
INSERT 0 1
SELECT COUNT(*) FROM cr_co_reindex_table_gist_index;
count
-------
6
(1 row)
set enable_seqscan=off;
SET
select property from cr_co_reindex_table_gist_index where property='( (0,0), (6,6) )';
property
-------------
(6,6),(0,0)
(1 row)
drop table cr_co_reindex_table_gist_index;
DROP TABLE
TRUNCATE TABLE cr_co_truncate_table;
TRUNCATE TABLE
SELECT COUNT(*) FROM cr_co_truncate_table;
count
-------
0
(1 row)
DROP TABLE cr_co_truncate_table;
DROP TABLE
CREATE TABLE cr_hybrid_part (
PS_PARTKEY INTEGER,
PS_SUPPKEY INTEGER,
PS_AVAILQTY integer,
PS_SUPPLYCOST decimal,
PS_COMMENT VARCHAR(199)
)
partition by range (ps_supplycost)
subpartition by range (ps_suppkey)
,subpartition by range (ps_partkey) subpartition template (start('1') end('200001') every(66666)
)
(
partition p1 start('1') end('20') inclusive
(
subpartition sp1 start('1') end('3030') WITH (checksum=false, appendonly=true,blocksize=1171456,compresslevel=3),
subpartition sp2 end('6096') inclusive,
subpartition sp3 start('6096') exclusive end('7201') with (orientation='column',appendonly=true),
subpartition sp4 end('10001') WITH (checksum=false,appendonly=true, blocksize=1171456,compresslevel=3)
),
partition p2 end('1001') inclusive
(
subpartition sp1 start('1') ,
subpartition sp2 start('4139') with (orientation='column',appendonly=true) ,
subpartition sp3 start('4685') WITH (checksum=false,appendonly=true, blocksize=1171456,compresslevel=3) ,
subpartition sp4 start('5675') )
);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'ps_partkey' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1" for table "cr_hybrid_part"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2" for table "cr_hybrid_part"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp1" for table "cr_hybrid_part_1_prt_p1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp2" for table "cr_hybrid_part_1_prt_p1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp3" for table "cr_hybrid_part_1_prt_p1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp4" for table "cr_hybrid_part_1_prt_p1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp1_3_prt_1" for table "cr_hybrid_part_1_prt_p1_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp1_3_prt_2" for table "cr_hybrid_part_1_prt_p1_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp1_3_prt_3" for table "cr_hybrid_part_1_prt_p1_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp1_3_prt_4" for table "cr_hybrid_part_1_prt_p1_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp2_3_prt_1" for table "cr_hybrid_part_1_prt_p1_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp2_3_prt_2" for table "cr_hybrid_part_1_prt_p1_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp2_3_prt_3" for table "cr_hybrid_part_1_prt_p1_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp2_3_prt_4" for table "cr_hybrid_part_1_prt_p1_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp3_3_prt_1" for table "cr_hybrid_part_1_prt_p1_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp3_3_prt_2" for table "cr_hybrid_part_1_prt_p1_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp3_3_prt_3" for table "cr_hybrid_part_1_prt_p1_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp3_3_prt_4" for table "cr_hybrid_part_1_prt_p1_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp4_3_prt_1" for table "cr_hybrid_part_1_prt_p1_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp4_3_prt_2" for table "cr_hybrid_part_1_prt_p1_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp4_3_prt_3" for table "cr_hybrid_part_1_prt_p1_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p1_2_prt_sp4_3_prt_4" for table "cr_hybrid_part_1_prt_p1_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp1" for table "cr_hybrid_part_1_prt_p2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp2" for table "cr_hybrid_part_1_prt_p2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp3" for table "cr_hybrid_part_1_prt_p2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp4" for table "cr_hybrid_part_1_prt_p2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp1_3_prt_1" for table "cr_hybrid_part_1_prt_p2_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp1_3_prt_2" for table "cr_hybrid_part_1_prt_p2_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp1_3_prt_3" for table "cr_hybrid_part_1_prt_p2_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp1_3_prt_4" for table "cr_hybrid_part_1_prt_p2_2_prt_sp1"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp2_3_prt_1" for table "cr_hybrid_part_1_prt_p2_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp2_3_prt_2" for table "cr_hybrid_part_1_prt_p2_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp2_3_prt_3" for table "cr_hybrid_part_1_prt_p2_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp2_3_prt_4" for table "cr_hybrid_part_1_prt_p2_2_prt_sp2"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp3_3_prt_1" for table "cr_hybrid_part_1_prt_p2_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp3_3_prt_2" for table "cr_hybrid_part_1_prt_p2_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp3_3_prt_3" for table "cr_hybrid_part_1_prt_p2_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp3_3_prt_4" for table "cr_hybrid_part_1_prt_p2_2_prt_sp3"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp4_3_prt_1" for table "cr_hybrid_part_1_prt_p2_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp4_3_prt_2" for table "cr_hybrid_part_1_prt_p2_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp4_3_prt_3" for table "cr_hybrid_part_1_prt_p2_2_prt_sp4"
psql:/path/sql_file:1: NOTICE: CREATE TABLE will create partition "cr_hybrid_part_1_prt_p2_2_prt_sp4_3_prt_4" for table "cr_hybrid_part_1_prt_p2_2_prt_sp4"
CREATE TABLE
\d cr_hybrid_part
Table "public.cr_hybrid_part"
Column | Type | Modifiers
---------------+------------------------+-----------
ps_partkey | integer |
ps_suppkey | integer |
ps_availqty | integer |
ps_supplycost | numeric |
ps_comment | character varying(199) |
Number of child tables: 2 (Use \d+ to list them.)
Distributed by: (ps_partkey)
COPY cr_hybrid_part FROM STDIN delimiter as '|';
select count(*) from cr_hybrid_part;
count
-------
10000
(1 row)
drop table cr_hybrid_part;
DROP TABLE
CREATE TABLE cr_table_with_oid (
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric
) WITH OIDS DISTRIBUTED RANDOMLY;
psql:/path/sql_file:1: NOTICE: OIDS=TRUE is not recommended for user-created tables. Use OIDS=FALSE to prevent wrap-around of the OID counter
CREATE TABLE
\d cr_table_with_oid
Table "public.cr_table_with_oid"
Column | Type | Modifiers
---------------+-----------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
Distributed randomly
insert into cr_table_with_oid select i||'_'||repeat('text',100),i,i||'_'||repeat('text',5),i from generate_series(1,100)i;
INSERT 0 100
select count(*) from cr_table_with_oid;
count
-------
100
(1 row)
DROP TABLE cr_table_with_oid;
DROP TABLE
CLUSTER cr_cluster_btree_idx1 ON cr_cluster_table_btree_index ;
CLUSTER
insert into cr_cluster_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,200)i;
INSERT 0 100
select count(*) from cr_cluster_table_btree_index;
count
-------
201
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_cluster_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_cluster_table_btree_index;
DROP TABLE
CLUSTER cr_cluster_gist_idx1 ON cr_cluster_table_gist_index ;
CLUSTER
\d cr_cluster_table_gist_index
Table "public.cr_cluster_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Indexes:
"cr_cluster_gist_idx1" gist (property) CLUSTER
Distributed by: (id)
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
INSERT 0 1
select count(*) from cr_cluster_table_gist_index;
count
-------
6
(1 row)
set enable_seqscan=off;
SET
select property from cr_cluster_table_gist_index where property='( (0,0), (6,6) )';
property
-------------
(6,6),(0,0)
(1 row)
drop table cr_cluster_table_gist_index;
DROP TABLE
CREATE INDEX cr_heap_bitmap_idx1 ON cr_heap_table_bitmap_index USING bitmap (numeric_col);
CREATE INDEX
\d cr_heap_table_bitmap_index
Table "public.cr_heap_table_bitmap_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Indexes:
"cr_heap_bitmap_idx1" bitmap (numeric_col)
Distributed by: (text_col)
insert into cr_heap_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_heap_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_heap_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_heap_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
set enable_seqscan=off;
SET
select numeric_col from cr_heap_table_bitmap_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_heap_table_bitmap_index;
DROP TABLE
CREATE INDEX cr_heap_btree_idx1 ON cr_heap_table_btree_index (numeric_col);
CREATE INDEX
\d cr_heap_table_btree_index
Table "public.cr_heap_table_btree_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Indexes:
"cr_heap_btree_idx1" btree (numeric_col)
Distributed by: (text_col)
insert into cr_heap_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_heap_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_heap_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_heap_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
set enable_seqscan=off;
SET
select distinct numeric_col from cr_heap_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_heap_table_btree_index;
DROP TABLE
CREATE INDEX cr_heap_gist_idx1 ON cr_heap_table_gist_index USING GiST (property);
CREATE INDEX
\d cr_heap_table_gist_index
Table "public.cr_heap_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Indexes:
"cr_heap_gist_idx1" gist (property)
Distributed by: (id)
set enable_seqscan=off;
SET
select property from cr_heap_table_gist_index where property='( (0,0), (1,1) )';
property
-------------
(1,1),(0,0)
(1 row)
DROP TABLE cr_heap_table_gist_index;
DROP TABLE
CREATE TABLE cr_heap_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp );
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
INSERT INTO cr_heap_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 1
DROP TABLE cr_heap_table;
DROP TABLE
CREATE TABLE heap_jit_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) tablespace twophase_test_ts ;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
\d heap_jit_table
Table "public.heap_jit_table"
Column | Type | Modifiers
--------+-----------------------------+----------------------------------------------
phase | text |
a | integer |
col001 | character(1) | default 'z'::bpchar
col002 | numeric |
col003 | boolean | default false
col004 | bit(3) | default B'111'::"bit"
col005 | text | default 'pookie'::text
col006 | integer[] | default '{5,4,3,2,1}'::integer[]
col007 | character varying(512) | default 'Now is the time'::character varying
col008 | character varying | default 'Now is the time'::character varying
col009 | character varying(512)[] |
col010 | numeric(8,0) |
col011 | integer |
col012 | double precision |
col013 | bigint |
col014 | character(8) |
col015 | bytea |
col016 | timestamp with time zone |
col017 | interval |
col018 | cidr |
col019 | inet |
col020 | macaddr |
col022 | money |
col024 | time with time zone |
col025 | circle |
col026 | box |
col027 | name |
col028 | path |
col029 | smallint |
col031 | bit varying(256) |
col032 | date |
col034 | lseg |
col035 | point |
col036 | polygon |
col037 | real |
col039 | time without time zone |
col040 | timestamp without time zone |
Distributed by: (phase)
Tablespace: "twophase_test_ts"
INSERT INTO heap_jit_table VALUES ('sync1_heap1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 10
DROP table heap_jit_table;
DROP TABLE
REINDEX INDEX cr_heap_reindex_bitmap_idx1;
REINDEX
\d cr_heap_reindex_table_bitmap_index
Table "public.cr_heap_reindex_table_bitmap_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Indexes:
"cr_heap_reindex_bitmap_idx1" bitmap (numeric_col)
Distributed by: (text_col)
insert into cr_heap_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
INSERT 0 10
SELECT COUNT(*) FROM cr_heap_reindex_table_bitmap_index;
count
-------
111
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_heap_reindex_table_bitmap_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_heap_reindex_table_bitmap_index;
DROP TABLE
REINDEX INDEX cr_heap_reindex_btree_idx1;
REINDEX
\d cr_heap_reindex_table_btree_index
Table "public.cr_heap_reindex_table_btree_index"
Column | Type | Modifiers
---------------------+-----------------------------+-----------
text_col | text |
bigint_col | bigint |
char_vary_col | character varying(30) |
numeric_col | numeric |
int_col | integer |
float_col | real |
int_array_col | integer[] |
drop_col | numeric |
before_rename_col | integer |
change_datatype_col | numeric |
a_ts_without | timestamp without time zone |
b_ts_with | timestamp with time zone |
date_column | date |
Indexes:
"cr_heap_reindex_btree_idx1" btree (numeric_col)
Distributed by: (text_col)
insert into cr_heap_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
INSERT 0 10
SELECT COUNT(*) FROM cr_heap_reindex_table_btree_index;
count
-------
111
(1 row)
set enable_seqscan=off;
SET
select numeric_col from cr_heap_reindex_table_btree_index where numeric_col=1;
numeric_col
-------------
1
(1 row)
drop table cr_heap_reindex_table_btree_index;
DROP TABLE
REINDEX INDEX cr_heap_reindex_gist_idx1;
REINDEX
\d cr_heap_reindex_table_gist_index
Table "public.cr_heap_reindex_table_gist_index"
Column | Type | Modifiers
----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------
id | integer |
property | box |
filler | character varying | default 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinhead
Indexes:
"cr_heap_reindex_gist_idx1" gist (property)
Distributed by: (id)
INSERT INTO cr_heap_reindex_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
INSERT 0 1
SELECT COUNT(*) FROM cr_heap_reindex_table_gist_index;
count
-------
6
(1 row)
set enable_seqscan=off;
SET
select property from cr_heap_reindex_table_gist_index where property='( (0,0), (6,6) )';
property
-------------
(6,6),(0,0)
(1 row)
drop table cr_heap_reindex_table_gist_index;
DROP TABLE
TRUNCATE TABLE cr_heap_truncate_table;
TRUNCATE TABLE
SELECT COUNT(*) FROM cr_heap_truncate_table;
count
-------
0
(1 row)
DROP TABLE cr_heap_truncate_table;
DROP TABLE
alter table ao_table_for_alter set tablespace twophase_test_ts2;
\d ao_table_for_alter
INSERT INTO ao_table_for_alter VALUES ('sync1_ao1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP table ao_table_for_alter;
alter table co_table_for_alter set tablespace twophase_test_ts2;
\d co_table_for_alter
INSERT INTO co_table_for_alter VALUES ('sync1_co1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP table co_table_for_alter;
alter table heap_table_for_alter set tablespace twophase_test_ts2;
\d heap_table_for_alter
INSERT INTO heap_table_for_alter VALUES ('sync1_heap1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP table heap_table_for_alter;
CREATE INDEX cr_ao_bitmap_idx1 ON cr_ao_table_bitmap_index USING bitmap (numeric_col);
\d cr_ao_table_bitmap_index
insert into cr_ao_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
insert into cr_ao_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
insert into cr_ao_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
insert into cr_ao_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
set enable_seqscan=off;
select numeric_col from cr_ao_table_bitmap_index where numeric_col=1;
drop table cr_ao_table_bitmap_index;
CREATE INDEX cr_ao_btree_idx1 ON cr_ao_table_btree_index (numeric_col);
\d cr_ao_table_btree_index
insert into cr_ao_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
insert into cr_ao_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
insert into cr_ao_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
insert into cr_ao_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
set enable_seqscan=off;
select numeric_col from cr_ao_table_btree_index where numeric_col=1;
drop table cr_ao_table_btree_index;
CREATE INDEX cr_ao_gist_idx1 ON cr_ao_table_gist_index USING GiST (property);
\d cr_ao_table_gist_index
set enable_seqscan=off;
select property from cr_ao_table_gist_index where property='( (0,0), (1,1) )';
DROP TABLE cr_ao_table_gist_index;
CREATE TABLE cr_ao_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) with (appendonly = true);
INSERT INTO cr_ao_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP TABLE cr_ao_table;
CREATE TABLE ao_jit_table( phase text,a int,aol001 char DEFAULT 'z',aol002 numeric,aol003 boolean DEFAULT false,aol004 bit(3) DEFAULT '111',
aol005 text DEFAULT 'pookie', aol006 integer[] DEFAULT '{5, 4, 3, 2, 1}', aol007 character varying(512) DEFAULT 'Now is the time', aol008 character varying DEFAULT 'Now is the time',
aol009 character varying(512)[], aol010 numeric(8),aol011 int,aol012 double precision, aol013 bigint, aol014 char(8), aol015 bytea,aol016 timestamp with time zone,aol017 interval,
aol018 cidr, aol019 inet, aol020 macaddr,aol022 money, aol024 timetz,aol025 circle, aol026 box, aol027 name,aol028 path, aol029 int2, aol031 bit varying(256),
aol032 date, aol034 lseg,aol035 point,aol036 polygon,aol037 real,aol039 time, aol040 timestamp ) WITH (appendonly=true) tablespace twophase_test_ts ;
\d ao_jit_table
INSERT INTO ao_jit_table VALUES ('sync1_ao1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP table ao_jit_table;
REINDEX INDEX cr_ao_reindex_bitmap_idx1;
\d cr_ao_reindex_table_bitmap_index
insert into cr_ao_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
SELECT COUNT(*) FROM cr_ao_reindex_table_bitmap_index;
set enable_seqscan=off;
select numeric_col from cr_ao_reindex_table_bitmap_index where numeric_col=1;
drop table cr_ao_reindex_table_bitmap_index;
REINDEX INDEX cr_ao_reindex_btree_idx1;
\d cr_ao_reindex_table_btree_index
insert into cr_ao_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
SELECT COUNT(*) FROM cr_ao_reindex_table_btree_index;
set enable_seqscan=off;
select numeric_col from cr_ao_reindex_table_btree_index where numeric_col=1;
drop table cr_ao_reindex_table_btree_index;
REINDEX INDEX cr_ao_reindex_gist_idx1;
\d cr_ao_reindex_table_gist_index
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
SELECT COUNT(*) FROM cr_ao_reindex_table_gist_index;
set enable_seqscan=off;
select property from cr_ao_reindex_table_gist_index where property='( (0,0), (6,6) )';
drop table cr_ao_reindex_table_gist_index;
TRUNCATE TABLE cr_ao_truncate_table;
SELECT COUNT(*) FROM cr_ao_truncate_table;
DROP TABLE cr_ao_truncate_table;
CREATE INDEX cr_co_bitmap_idx1 ON cr_co_table_bitmap_index USING bitmap (numeric_col);
\d cr_co_table_bitmap_index
insert into cr_co_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
insert into cr_co_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
insert into cr_co_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
insert into cr_co_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
set enable_seqscan=off;
select numeric_col from cr_co_table_bitmap_index where numeric_col=1;
drop table cr_co_table_bitmap_index;
CREATE INDEX cr_co_btree_idx1 ON cr_co_table_btree_index (numeric_col);
\d cr_co_table_btree_index
insert into cr_co_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
insert into cr_co_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
insert into cr_co_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
insert into cr_co_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
set enable_seqscan=off;
select numeric_col from cr_co_table_btree_index where numeric_col=1;
drop table cr_co_table_btree_index;
CREATE INDEX cr_co_gist_idx1 ON cr_co_table_gist_index USING GiST (property);
\d cr_co_table_gist_index
set enable_seqscan=off;
select property from cr_co_table_gist_index where property='( (0,0), (1,1) )';
DROP TABLE cr_co_table_gist_index;
CREATE TABLE cr_co_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) with (appendonly = true, orientation = column);
INSERT INTO cr_co_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP TABLE cr_co_table;
CREATE TABLE co_jit_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) WITH (appendonly=true,orientation=column) tablespace twophase_test_ts ;
\d co_jit_table
INSERT INTO co_jit_table VALUES ('sync1_co1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP table co_jit_table;
REINDEX INDEX cr_co_reindex_bitmap_idx1;
\d cr_co_reindex_table_bitmap_index
insert into cr_co_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
SELECT COUNT(*) FROM cr_co_reindex_table_bitmap_index;
set enable_seqscan=off;
select numeric_col from cr_co_reindex_table_bitmap_index where numeric_col=1;
drop table cr_co_reindex_table_bitmap_index;
REINDEX INDEX cr_co_reindex_btree_idx1;
\d cr_co_reindex_table_btree_index
insert into cr_co_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
SELECT COUNT(*) FROM cr_co_reindex_table_btree_index;
set enable_seqscan=off;
select numeric_col from cr_co_reindex_table_btree_index where numeric_col=1;
drop table cr_co_reindex_table_btree_index;
REINDEX INDEX cr_co_reindex_gist_idx1;
\d cr_co_reindex_table_gist_index
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
SELECT COUNT(*) FROM cr_co_reindex_table_gist_index;
set enable_seqscan=off;
select property from cr_co_reindex_table_gist_index where property='( (0,0), (6,6) )';
drop table cr_co_reindex_table_gist_index;
TRUNCATE TABLE cr_co_truncate_table;
SELECT COUNT(*) FROM cr_co_truncate_table;
DROP TABLE cr_co_truncate_table;
CREATE TABLE cr_table_with_oid (
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric
) WITH OIDS DISTRIBUTED RANDOMLY;
\d cr_table_with_oid
insert into cr_table_with_oid select i||'_'||repeat('text',100),i,i||'_'||repeat('text',5),i from generate_series(1,100)i;
select count(*) from cr_table_with_oid;
DROP TABLE cr_table_with_oid;
CLUSTER cr_cluster_btree_idx1 ON cr_cluster_table_btree_index ;
insert into cr_cluster_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,200)i;
select count(*) from cr_cluster_table_btree_index;
set enable_seqscan=off;
select numeric_col from cr_cluster_table_btree_index where numeric_col=1;
drop table cr_cluster_table_btree_index;
CLUSTER cr_cluster_gist_idx1 ON cr_cluster_table_gist_index ;
\d cr_cluster_table_gist_index
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
select count(*) from cr_cluster_table_gist_index;
set enable_seqscan=off;
select property from cr_cluster_table_gist_index where property='( (0,0), (6,6) )';
drop table cr_cluster_table_gist_index;
CREATE INDEX cr_heap_bitmap_idx1 ON cr_heap_table_bitmap_index USING bitmap (numeric_col);
\d cr_heap_table_bitmap_index
insert into cr_heap_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
insert into cr_heap_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
insert into cr_heap_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
insert into cr_heap_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
set enable_seqscan=off;
select numeric_col from cr_heap_table_bitmap_index where numeric_col=1;
drop table cr_heap_table_bitmap_index;
CREATE INDEX cr_heap_btree_idx1 ON cr_heap_table_btree_index (numeric_col);
\d cr_heap_table_btree_index
insert into cr_heap_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
insert into cr_heap_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
insert into cr_heap_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
insert into cr_heap_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
set enable_seqscan=off;
select distinct numeric_col from cr_heap_table_btree_index where numeric_col=1;
drop table cr_heap_table_btree_index;
CREATE INDEX cr_heap_gist_idx1 ON cr_heap_table_gist_index USING GiST (property);
\d cr_heap_table_gist_index
set enable_seqscan=off;
select property from cr_heap_table_gist_index where property='( (0,0), (1,1) )';
DROP TABLE cr_heap_table_gist_index;
CREATE TABLE cr_heap_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp );
INSERT INTO cr_heap_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP TABLE cr_heap_table;
CREATE TABLE heap_jit_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) tablespace twophase_test_ts ;
\d heap_jit_table
INSERT INTO heap_jit_table VALUES ('sync1_heap1',generate_series(1,10),'a',11,true,'111', repeat('text_',10), '{1,2,3,4,5}', 'Hello .. how are you 1
', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '
((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
DROP table heap_jit_table;
REINDEX INDEX cr_heap_reindex_bitmap_idx1;
\d cr_heap_reindex_table_bitmap_index
insert into cr_heap_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
SELECT COUNT(*) FROM cr_heap_reindex_table_bitmap_index;
set enable_seqscan=off;
select numeric_col from cr_heap_reindex_table_bitmap_index where numeric_col=1;
drop table cr_heap_reindex_table_bitmap_index;
REINDEX INDEX cr_heap_reindex_btree_idx1;
\d cr_heap_reindex_table_btree_index
insert into cr_heap_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(101,110)i;
SELECT COUNT(*) FROM cr_heap_reindex_table_btree_index;
set enable_seqscan=off;
select numeric_col from cr_heap_reindex_table_btree_index where numeric_col=1;
drop table cr_heap_reindex_table_btree_index;
REINDEX INDEX cr_heap_reindex_gist_idx1;
\d cr_heap_reindex_table_gist_index
INSERT INTO cr_heap_reindex_table_gist_index (id, property) VALUES (6, '( (0,0), (6,6) )');
SELECT COUNT(*) FROM cr_heap_reindex_table_gist_index;
set enable_seqscan=off;
select property from cr_heap_reindex_table_gist_index where property='( (0,0), (6,6) )';
drop table cr_heap_reindex_table_gist_index;
TRUNCATE TABLE cr_heap_truncate_table;
SELECT COUNT(*) FROM cr_heap_truncate_table;
DROP TABLE cr_heap_truncate_table;
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from mpp.models import SQLTestCase
'''
Post sqls for create_tests
'''
class TestPostSQLClass(SQLTestCase):
sql_dir = 'sql/'
ans_dir = 'expected/'
out_dir = 'output/'
CREATE TABLE ao_table_for_alter (phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp) WITH (appendonly=true) tablespace twophase_test_ts;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE co_table_for_alter (phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp) WITH (appendonly=true, orientation=column) tablespace twophase_test_ts;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE heap_table_for_alter (phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',
col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time',
col009 character varying(512)[], col010 numeric(8),col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval,
col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),
col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp) tablespace twophase_test_ts;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_ao_table_bitmap_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly=true);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_ao_table_btree_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly=true);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_ao_table_gist_index (
id INTEGER,
property BOX,
filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground. How can you listen when you know?'
) WITH (appendonly=true)
DISTRIBUTED BY (id);
CREATE TABLE
INSERT INTO cr_ao_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT 0 1
INSERT INTO cr_ao_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT 0 1
INSERT INTO cr_ao_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT 0 1
INSERT INTO cr_ao_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT 0 1
INSERT INTO cr_ao_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
INSERT 0 1
CREATE TABLE cr_ao_reindex_table_bitmap_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly = true);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE INDEX cr_ao_reindex_bitmap_idx1 ON cr_ao_reindex_table_bitmap_index USING bitmap (numeric_col);
CREATE INDEX
insert into cr_ao_reindex_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_ao_reindex_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_ao_reindex_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_ao_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
SELECT COUNT(*) FROM cr_ao_reindex_table_bitmap_index;
count
-------
101
(1 row)
CREATE TABLE cr_ao_reindex_table_btree_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly = true);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE INDEX cr_ao_reindex_btree_idx1 ON cr_ao_reindex_table_btree_index (numeric_col);
CREATE INDEX
insert into cr_ao_reindex_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_ao_reindex_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_ao_reindex_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_ao_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
SELECT COUNT(*) FROM cr_ao_reindex_table_btree_index;
count
-------
101
(1 row)
CREATE TABLE cr_ao_reindex_table_gist_index (
id INTEGER,
property BOX,
filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground. How can you listen when you know?'
) WITH (appendonly = true)
DISTRIBUTED BY (id);
CREATE TABLE
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT 0 1
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT 0 1
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT 0 1
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT 0 1
INSERT INTO cr_ao_reindex_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
INSERT 0 1
CREATE INDEX cr_ao_reindex_gist_idx1 ON cr_ao_reindex_table_gist_index USING GiST (property);
CREATE INDEX
SELECT COUNT(*) FROM cr_ao_reindex_table_gist_index;
count
-------
5
(1 row)
CREATE TABLE cr_ao_truncate_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) WITH (appendonly=true);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
INSERT INTO cr_ao_truncate_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 1
CREATE TABLE cr_co_table_bitmap_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly=true, orientation=column);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_co_table_btree_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly=true, orientation=column);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_co_table_gist_index (
id INTEGER,
property BOX,
filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground. How can you listen when you know?'
) WITH (appendonly=true, orientation=column)
DISTRIBUTED BY (id);
CREATE TABLE
INSERT INTO cr_co_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT 0 1
INSERT INTO cr_co_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT 0 1
INSERT INTO cr_co_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT 0 1
INSERT INTO cr_co_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT 0 1
INSERT INTO cr_co_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
INSERT 0 1
CREATE TABLE cr_co_reindex_table_bitmap_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly = true, orientation = column);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE INDEX cr_co_reindex_bitmap_idx1 ON cr_co_reindex_table_bitmap_index USING bitmap (numeric_col);
CREATE INDEX
insert into cr_co_reindex_table_bitmap_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_co_reindex_table_bitmap_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_co_reindex_table_bitmap_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_co_reindex_table_bitmap_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
SELECT COUNT(*) FROM cr_co_reindex_table_bitmap_index;
count
-------
101
(1 row)
CREATE TABLE cr_co_reindex_table_btree_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) WITH (appendonly = true, orientation = column);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE INDEX cr_co_reindex_btree_idx1 ON cr_co_reindex_table_btree_index (numeric_col);
CREATE INDEX
insert into cr_co_reindex_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_co_reindex_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_co_reindex_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_co_reindex_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
SELECT COUNT(*) FROM cr_co_reindex_table_btree_index;
count
-------
101
(1 row)
CREATE TABLE cr_co_reindex_table_gist_index (
id INTEGER,
property BOX,
filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground. How can you listen when you know?'
) WITH (appendonly = true,orientation = column)
DISTRIBUTED BY (id);
CREATE TABLE
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT 0 1
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT 0 1
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT 0 1
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT 0 1
INSERT INTO cr_co_reindex_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
INSERT 0 1
CREATE INDEX cr_co_reindex_gist_idx1 ON cr_co_reindex_table_gist_index USING GiST (property);
CREATE INDEX
SELECT COUNT(*) FROM cr_co_reindex_table_gist_index;
count
-------
5
(1 row)
CREATE TABLE cr_co_truncate_table( phase text,a int,col001 char DEFAULT 'z',col002 numeric,col003 boolean DEFAULT false,col004 bit(3) DEFAULT '111',col005 text DEFAULT 'pookie', col006 integer[] DEFAULT '{5, 4, 3, 2, 1}', col007 character varying(512) DEFAULT 'Now is the time', col008 character varying DEFAULT 'Now is the time', col009 character varying(512)[], col010 numeric(8) ,col011 int,col012 double precision, col013 bigint, col014 char(8), col015 bytea,col016 timestamp with time zone,col017 interval, col018 cidr, col019 inet, col020 macaddr,col022 money, col024 timetz,col025 circle, col026 box, col027 name,col028 path, col029 int2, col031 bit varying(256),col032 date, col034 lseg,col035 point,col036 polygon,col037 real,col039 time, col040 timestamp ) WITH (appendonly=true, orientation=column);
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'phase' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
INSERT INTO cr_co_truncate_table VALUES ('sync1_heap1',1,'a',11,true,'111', '1_one', '{1,2,3,4,5}', 'Hello .. how are you 1', 'Hello .. how are you 1', '{one,two,three,four,five}', 12345678, 1, 111.1111, 11, '1_one_11', 'd',
'2001-12-13 01:51:15+1359', '11', '0.0.0.0', '0.0.0.0', 'AA:AA:AA:AA:AA:AA', '34.23', '00:00:00+1359', '((2,2),1)', '((1,2),(2,1))', 'hello', '((1,2),(2,1))', 11, '010101', '2001-12-13', '((1,1),(2,2))', '(1,1)', '((1,2),(2,3),(3,4),(4,3),(3,2),(2,1))', 111111, '23:00:00', '2001-12-13 01:51:15');
INSERT 0 1
CREATE TABLE cr_cluster_table_btree_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) ;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE INDEX cr_cluster_btree_idx1 ON cr_cluster_table_btree_index (numeric_col);
CREATE INDEX
insert into cr_cluster_table_btree_index values ('0_zero', 0, '0_zero', 0, 0, 0, '{0}', 0, 0, 0, '2004-10-19 10:23:54', '2004-10-19 10:23:54+02', '1-1-2000');
INSERT 0 1
insert into cr_cluster_table_btree_index values ('1_zero', 1, '1_zero', 1, 1, 1, '{1}', 1, 1, 1, '2005-10-19 10:23:54', '2005-10-19 10:23:54+02', '1-1-2001');
INSERT 0 1
insert into cr_cluster_table_btree_index values ('2_zero', 2, '2_zero', 2, 2, 2, '{2}', 2, 2, 2, '2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002');
INSERT 0 1
insert into cr_cluster_table_btree_index select i||'_'||repeat('text',100),i,i||'_'||repeat('text',3),i,i,i,'{3}',i,i,i,'2006-10-19 10:23:54', '2006-10-19 10:23:54+02', '1-1-2002' from generate_series(3,100)i;
INSERT 0 98
select count(*) from cr_cluster_table_btree_index;
count
-------
101
(1 row)
CREATE TABLE cr_cluster_table_gist_index (
id INTEGER,
property BOX,
filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground. How can you listen when you know?'
)
DISTRIBUTED BY (id);
CREATE TABLE
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT 0 1
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT 0 1
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT 0 1
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT 0 1
INSERT INTO cr_cluster_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
INSERT 0 1
select count(*) from cr_cluster_table_gist_index;
count
-------
5
(1 row)
CREATE INDEX cr_cluster_gist_idx1 ON cr_cluster_table_gist_index USING GiST (property);
CREATE INDEX
select count(*) from cr_cluster_table_gist_index;
count
-------
5
(1 row)
CREATE TABLE cr_heap_table_bitmap_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) ;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_heap_table_btree_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without timestamp without time zone,
b_ts_with timestamp with time zone,
date_column date) ;
psql:/path/sql_file:1: NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'text_col' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
CREATE TABLE cr_heap_table_gist_index (
id INTEGER,
property BOX,
filler VARCHAR DEFAULT 'This is here just to take up space so that we use more pages of data and sequential scans take a lot more time. Stones tinheads and mixers coming; we did it all on our own; this summer I hear the crunching; 11 dead in Ohio. Got right down to it; we were cutting us down; could have had fun but, no; left them face down dead on the ground. How can you listen when you know?'
)
DISTRIBUTED BY (id);
CREATE TABLE
INSERT INTO cr_heap_table_gist_index (id, property) VALUES (1, '( (0,0), (1,1) )');
INSERT 0 1
INSERT INTO cr_heap_table_gist_index (id, property) VALUES (2, '( (0,0), (2,2) )');
INSERT 0 1
INSERT INTO cr_heap_table_gist_index (id, property) VALUES (3, '( (0,0), (3,3) )');
INSERT 0 1
INSERT INTO cr_heap_table_gist_index (id, property) VALUES (4, '( (0,0), (4,4) )');
INSERT 0 1
INSERT INTO cr_heap_table_gist_index (id, property) VALUES (5, '( (0,0), (5,5) )');
INSERT 0 1
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册