Allow multiple size function calls per query

pull/2089/head
Marco Slot 2018-04-05 12:06:05 +02:00
parent 6df6d841c9
commit 9318aeee6b
3 changed files with 17 additions and 0 deletions

View File

@ -214,6 +214,7 @@ DistributedTableSizeOnWorker(WorkerNode *workerNode, Oid relationId, char *sizeQ
PGresult *result = NULL;
int queryResult = 0;
List *sizeList = NIL;
bool raiseErrors = true;
List *shardIntervalsOnNode = ShardIntervalsOnWorkerGroup(workerNode, relationId);
@ -235,6 +236,8 @@ DistributedTableSizeOnWorker(WorkerNode *workerNode, Oid relationId, char *sizeQ
tableSizeString = tableSizeStringInfo->data;
tableSize = atol(tableSizeString);
ClearResults(connection, raiseErrors);
return tableSize;
}

View File

@ -49,6 +49,15 @@ SELECT citus_total_relation_size('customer_copy_hash');
1597440
(1 row)
-- Make sure we can get multiple sizes in a single query
SELECT citus_table_size('customer_copy_hash'),
citus_table_size('customer_copy_hash'),
citus_table_size('supplier');
citus_table_size | citus_table_size | citus_table_size
------------------+------------------+------------------
548864 | 548864 | 401408
(1 row)
CREATE INDEX index_1 on customer_copy_hash(c_custkey);
VACUUM (FULL) customer_copy_hash;
-- Tests on distributed table with index.

View File

@ -32,6 +32,11 @@ SELECT citus_table_size('customer_copy_hash');
SELECT citus_relation_size('customer_copy_hash');
SELECT citus_total_relation_size('customer_copy_hash');
-- Make sure we can get multiple sizes in a single query
SELECT citus_table_size('customer_copy_hash'),
citus_table_size('customer_copy_hash'),
citus_table_size('supplier');
CREATE INDEX index_1 on customer_copy_hash(c_custkey);
VACUUM (FULL) customer_copy_hash;