提交 e8295657 编写于 作者: H Heikki Linnakangas

Remove redundant tests on AO/AOCO tables.

We have tons of tests on creating AO and AOCO tables in the regular
regression suite, with and without checksum. And a lot of tests on inserts
to AO/AOCO tests. There are also tests on having indexes on tables,
including AO/AOCO tests. I don't see anything interesting in these
particular combinations.
上级 d6727d20
--
-- @created 2014-05-19 12:00:00
-- @modified 2014-05-19 12:00:00
-- @tags storage
-- @description AO table with checksum ON and with btree index
DROP TABLE IF EXISTS ao_checksum_on;
DROP TABLE
CREATE TABLE ao_checksum_on (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH (checksum=true, appendonly=true, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE TABLE
CREATE INDEX ao_checksum_on_btree_idx ON ao_checksum_on USING btree (c_custkey);
CREATE INDEX
insert into ao_checksum_on values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
INSERT 0 1
insert into ao_checksum_on values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
INSERT 0 1
insert into ao_checksum_on values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
INSERT 0 1
select count(*) as one from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'ao_checksum_on');
one
-----
1
(1 row)
--
-- @created 2014-05-19 12:00:00
-- @modified 2014-05-19 12:00:00
-- @tags storage
-- @description AO table with checksum OFF and with btree index
SET gp_default_storage_options = 'checksum=false';
SET
DROP TABLE IF EXISTS ao_checksum_off;
psql:/path/sql_file:1: NOTICE: table "ao_checksum_off" does not exist, skipping
DROP TABLE
CREATE TABLE ao_checksum_off (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH ( appendonly=true, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE TABLE
CREATE INDEX ao_checksum_off_btree_idx ON ao_checksum_off USING btree (c_custkey);
CREATE INDEX
insert into ao_checksum_off values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
INSERT 0 1
insert into ao_checksum_off values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
INSERT 0 1
insert into ao_checksum_off values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
INSERT 0 1
select count(*) as one from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'ao_checksum_off');
one
-----
0
(1 row)
--
-- @created 2014-10-9 12:00:00
-- @modified 2014-10-9 12:00:00
-- @tags storage
-- @description AOCO multiple insert to create multiple var-block for table with btree index
DROP TABLE IF EXISTS co_checksum_on;
DROP TABLE
CREATE TABLE co_checksum_on (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH (checksum=true, appendonly=true, orientation=column, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE TABLE
CREATE INDEX co_checksum_on_btree_idx ON co_checksum_on USING btree (c_custkey);
CREATE INDEX
insert into co_checksum_on values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
INSERT 0 1
insert into co_checksum_on values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
INSERT 0 1
insert into co_checksum_on values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
INSERT 0 1
select count(*) from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'co_checksum_on');
count
-------
1
(1 row)
--
-- @created 2014-10-9 12:00:00
-- @modified 2014-10-9 12:00:00
-- @tags storage
-- @description AOCO multiple insert to create multiple var-block for table with btree index
DROP TABLE IF EXISTS co_checksum_on;
DROP TABLE
CREATE TABLE co_checksum_on (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH (checksum=true, appendonly=true, orientation=column, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE TABLE
CREATE INDEX co_checksum_on_btree_idx ON co_checksum_on USING btree (c_custkey);
CREATE INDEX
insert into co_checksum_on values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
INSERT 0 1
insert into co_checksum_on values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
INSERT 0 1
insert into co_checksum_on values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
INSERT 0 1
select count(*) from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'co_checksum_on');
count
-------
1
(1 row)
--
-- @created 2014-05-19 12:00:00
-- @modified 2014-05-19 12:00:00
-- @tags storage
-- @description AO table with checksum ON and with btree index
DROP TABLE IF EXISTS ao_checksum_on;
CREATE TABLE ao_checksum_on (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH (checksum=true, appendonly=true, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE INDEX ao_checksum_on_btree_idx ON ao_checksum_on USING btree (c_custkey);
insert into ao_checksum_on values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
insert into ao_checksum_on values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
insert into ao_checksum_on values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
select count(*) as one from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'ao_checksum_on');
--
-- @created 2014-05-19 12:00:00
-- @modified 2014-05-19 12:00:00
-- @tags storage
-- @description AO table with checksum OFF and with btree index
SET gp_default_storage_options = 'checksum=false';
DROP TABLE IF EXISTS ao_checksum_off;
CREATE TABLE ao_checksum_off (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH ( appendonly=true, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE INDEX ao_checksum_off_btree_idx ON ao_checksum_off USING btree (c_custkey);
insert into ao_checksum_off values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
insert into ao_checksum_off values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
insert into ao_checksum_off values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
select count(*) as one from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'ao_checksum_off');
--
-- @created 2014-10-9 12:00:00
-- @modified 2014-10-9 12:00:00
-- @tags storage
-- @description AOCO multiple insert to create multiple var-block for table with btree index
DROP TABLE IF EXISTS co_checksum_on;
CREATE TABLE co_checksum_on (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH (checksum=true, appendonly=true, orientation=column, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE INDEX co_checksum_on_btree_idx ON co_checksum_on USING btree (c_custkey);
insert into co_checksum_on values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
insert into co_checksum_on values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
insert into co_checksum_on values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
select count(*) from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'co_checksum_on');
--
-- @created 2014-10-9 12:00:00
-- @modified 2014-10-9 12:00:00
-- @tags storage
-- @description AOCO multiple insert to create multiple var-block for table with btree index
DROP TABLE IF EXISTS co_checksum_on;
CREATE TABLE co_checksum_on (
c_custkey integer,
c_name character varying(25),
c_comment text,
c_rating float,
c_phone character(15),
c_acctbal numeric(15,2),
c_date date,
c_timestamp timestamp
)
WITH (checksum=true, appendonly=true, orientation=column, compresstype=quicklz, compresslevel=1) DISTRIBUTED BY (c_custkey);
CREATE INDEX co_checksum_on_btree_idx ON co_checksum_on USING btree (c_custkey);
insert into co_checksum_on values( 1, 'aa','this is a looong text' , 3.5, '12121212',1000.34,'2015/10/10',now());
insert into co_checksum_on values( 2, 'ab','this is also a looong text' , 4.5, '3456789',3000.45,'2014/08/10',now());
insert into co_checksum_on values( 3, 'ac','this too is a looong text' , 1.5, '878787',500.54,'2014/04/04',now());
select count(*) from pg_appendonly where checksum=True and relid = (select oid from pg_class where relname = 'co_checksum_on');
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
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
'''
Sql test for appendonly checksum feature
'''
class AOCOAlterColumnTestCase(SQLTestCase):
'''
@gucs gp_create_table_random_default_distribution=off
@optimizer_mode off
@tags ORCA
@product_version gpdb: [4.3.4.0-]
'''
sql_dir = 'sql/'
ans_dir = 'expected/'
out_dir = 'output/'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册