mirror of https://github.com/citusdata/citus.git
Allow multiple size function calls per query
parent
6df6d841c9
commit
9318aeee6b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue