mirror of https://github.com/citusdata/citus.git
Move stripe.chunk_count to last position
parent
1c4081ea5f
commit
e690d8b79b
|
@ -139,9 +139,9 @@ typedef FormData_columnar_options *Form_columnar_options;
|
||||||
#define Anum_columnar_stripe_file_offset 3
|
#define Anum_columnar_stripe_file_offset 3
|
||||||
#define Anum_columnar_stripe_data_length 4
|
#define Anum_columnar_stripe_data_length 4
|
||||||
#define Anum_columnar_stripe_column_count 5
|
#define Anum_columnar_stripe_column_count 5
|
||||||
#define Anum_columnar_stripe_chunk_count 6
|
#define Anum_columnar_stripe_chunk_row_count 6
|
||||||
#define Anum_columnar_stripe_chunk_row_count 7
|
#define Anum_columnar_stripe_row_count 7
|
||||||
#define Anum_columnar_stripe_row_count 8
|
#define Anum_columnar_stripe_chunk_count 8
|
||||||
|
|
||||||
/* constants for columnar.chunk_group */
|
/* constants for columnar.chunk_group */
|
||||||
#define Natts_columnar_chunkgroup 4
|
#define Natts_columnar_chunkgroup 4
|
||||||
|
@ -633,9 +633,9 @@ InsertStripeMetadataRow(uint64 storageId, StripeMetadata *stripe)
|
||||||
Int64GetDatum(stripe->fileOffset),
|
Int64GetDatum(stripe->fileOffset),
|
||||||
Int64GetDatum(stripe->dataLength),
|
Int64GetDatum(stripe->dataLength),
|
||||||
Int32GetDatum(stripe->columnCount),
|
Int32GetDatum(stripe->columnCount),
|
||||||
Int32GetDatum(stripe->chunkCount),
|
|
||||||
Int32GetDatum(stripe->chunkRowCount),
|
Int32GetDatum(stripe->chunkRowCount),
|
||||||
Int64GetDatum(stripe->rowCount)
|
Int64GetDatum(stripe->rowCount),
|
||||||
|
Int32GetDatum(stripe->chunkCount)
|
||||||
};
|
};
|
||||||
|
|
||||||
Oid columnarStripesOid = ColumnarStripeRelationId();
|
Oid columnarStripesOid = ColumnarStripeRelationId();
|
||||||
|
|
|
@ -21,9 +21,9 @@ CREATE TABLE stripe (
|
||||||
file_offset bigint NOT NULL,
|
file_offset bigint NOT NULL,
|
||||||
data_length bigint NOT NULL,
|
data_length bigint NOT NULL,
|
||||||
column_count int NOT NULL,
|
column_count int NOT NULL,
|
||||||
chunk_count int NOT NULL,
|
|
||||||
chunk_row_count int NOT NULL,
|
chunk_row_count int NOT NULL,
|
||||||
row_count bigint NOT NULL,
|
row_count bigint NOT NULL,
|
||||||
|
chunk_group_count int NOT NULL,
|
||||||
PRIMARY KEY (storage_id, stripe_num)
|
PRIMARY KEY (storage_id, stripe_num)
|
||||||
) WITH (user_catalog_table = true);
|
) WITH (user_catalog_table = true);
|
||||||
|
|
||||||
|
|
|
@ -55,5 +55,15 @@ WITH a as (
|
||||||
), c as (
|
), c as (
|
||||||
(TABLE a EXCEPT TABLE b) UNION (TABLE b EXCEPT TABLE a) UNION
|
(TABLE a EXCEPT TABLE b) UNION (TABLE b EXCEPT TABLE a) UNION
|
||||||
(TABLE a EXCEPT TABLE columnar.chunk_group) UNION (TABLE columnar.chunk_group EXCEPT TABLE a)
|
(TABLE a EXCEPT TABLE columnar.chunk_group) UNION (TABLE columnar.chunk_group EXCEPT TABLE a)
|
||||||
|
), d as (
|
||||||
|
SELECT storage_id, stripe_num, count(*) as chunk_group_count
|
||||||
|
FROM columnar.chunk_group
|
||||||
|
GROUP BY 1,2
|
||||||
|
), e as (
|
||||||
|
SELECT storage_id, stripe_num, chunk_group_count
|
||||||
|
FROM columnar.stripe
|
||||||
|
), f as (
|
||||||
|
(TABLE d EXCEPT TABLE d) UNION (TABLE e EXCEPT TABLE d)
|
||||||
)
|
)
|
||||||
SELECT count(*) = 0 AS consistent FROM c;
|
SELECT (SELECT count(*) = 0 FROM c) AND
|
||||||
|
(SELECT count(*) = 0 FROM f) as consistent;
|
||||||
|
|
|
@ -173,16 +173,16 @@ INSERT INTO zero_col_heap SELECT * FROM zero_col_heap;
|
||||||
INSERT INTO zero_col_heap SELECT * FROM zero_col_heap;
|
INSERT INTO zero_col_heap SELECT * FROM zero_col_heap;
|
||||||
INSERT INTO zero_col_heap SELECT * FROM zero_col_heap;
|
INSERT INTO zero_col_heap SELECT * FROM zero_col_heap;
|
||||||
INSERT INTO zero_col SELECT * FROM zero_col_heap;
|
INSERT INTO zero_col SELECT * FROM zero_col_heap;
|
||||||
SELECT relname, stripe_num, row_count FROM columnar.stripe a, pg_class b
|
SELECT relname, stripe_num, chunk_group_count, row_count FROM columnar.stripe a, pg_class b
|
||||||
WHERE columnar_relation_storageid(b.oid)=a.storage_id AND relname = 'zero_col'
|
WHERE columnar_relation_storageid(b.oid)=a.storage_id AND relname = 'zero_col'
|
||||||
ORDER BY 1,2,3;
|
ORDER BY 1,2,3,4;
|
||||||
relname | stripe_num | row_count
|
relname | stripe_num | chunk_group_count | row_count
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
zero_col | 1 | 1
|
zero_col | 1 | 1 | 1
|
||||||
zero_col | 2 | 1
|
zero_col | 2 | 1 | 1
|
||||||
zero_col | 3 | 1
|
zero_col | 3 | 1 | 1
|
||||||
zero_col | 4 | 1
|
zero_col | 4 | 1 | 1
|
||||||
zero_col | 5 | 64
|
zero_col | 5 | 7 | 64
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
SELECT relname, stripe_num, value_count FROM columnar.chunk a, pg_class b
|
SELECT relname, stripe_num, value_count FROM columnar.chunk a, pg_class b
|
||||||
|
|
|
@ -59,5 +59,15 @@ WITH a as (
|
||||||
), c as (
|
), c as (
|
||||||
(TABLE a EXCEPT TABLE b) UNION (TABLE b EXCEPT TABLE a) UNION
|
(TABLE a EXCEPT TABLE b) UNION (TABLE b EXCEPT TABLE a) UNION
|
||||||
(TABLE a EXCEPT TABLE columnar.chunk_group) UNION (TABLE columnar.chunk_group EXCEPT TABLE a)
|
(TABLE a EXCEPT TABLE columnar.chunk_group) UNION (TABLE columnar.chunk_group EXCEPT TABLE a)
|
||||||
|
), d as (
|
||||||
|
SELECT storage_id, stripe_num, count(*) as chunk_group_count
|
||||||
|
FROM columnar.chunk_group
|
||||||
|
GROUP BY 1,2
|
||||||
|
), e as (
|
||||||
|
SELECT storage_id, stripe_num, chunk_group_count
|
||||||
|
FROM columnar.stripe
|
||||||
|
), f as (
|
||||||
|
(TABLE d EXCEPT TABLE d) UNION (TABLE e EXCEPT TABLE d)
|
||||||
)
|
)
|
||||||
SELECT count(*) = 0 AS consistent FROM c;
|
SELECT (SELECT count(*) = 0 FROM c) AND
|
||||||
|
(SELECT count(*) = 0 FROM f) as consistent;
|
||||||
|
|
|
@ -128,9 +128,9 @@ INSERT INTO zero_col_heap SELECT * FROM zero_col_heap;
|
||||||
|
|
||||||
INSERT INTO zero_col SELECT * FROM zero_col_heap;
|
INSERT INTO zero_col SELECT * FROM zero_col_heap;
|
||||||
|
|
||||||
SELECT relname, stripe_num, row_count FROM columnar.stripe a, pg_class b
|
SELECT relname, stripe_num, chunk_group_count, row_count FROM columnar.stripe a, pg_class b
|
||||||
WHERE columnar_relation_storageid(b.oid)=a.storage_id AND relname = 'zero_col'
|
WHERE columnar_relation_storageid(b.oid)=a.storage_id AND relname = 'zero_col'
|
||||||
ORDER BY 1,2,3;
|
ORDER BY 1,2,3,4;
|
||||||
|
|
||||||
SELECT relname, stripe_num, value_count FROM columnar.chunk a, pg_class b
|
SELECT relname, stripe_num, value_count FROM columnar.chunk a, pg_class b
|
||||||
WHERE columnar_relation_storageid(b.oid)=a.storage_id AND relname = 'zero_col'
|
WHERE columnar_relation_storageid(b.oid)=a.storage_id AND relname = 'zero_col'
|
||||||
|
|
Loading…
Reference in New Issue