mirror of https://github.com/citusdata/citus.git
rename to has_separate_node
parent
7d68e655bc
commit
a58442d411
|
@ -15,7 +15,7 @@ SELECT
|
|||
CASE
|
||||
WHEN NOT pg_dist_shard.needsisolatednode THEN false
|
||||
ELSE
|
||||
-- own_node = true if the node doesn't have any other shards except the ones that are colocated with this shard
|
||||
-- has_separate_node = true if the node doesn't have any other shards except the ones that are colocated with this shard
|
||||
NOT EXISTS (
|
||||
-- get all the distributed table shards that are placed on the same node as this shard
|
||||
SELECT pds1.shardid
|
||||
|
@ -32,7 +32,7 @@ SELECT
|
|||
WHERE pdp1.colocationid = pg_dist_partition.colocationid AND
|
||||
((pds1.shardminvalue IS NULL AND pg_dist_shard.shardminvalue IS NULL) OR (pds1.shardminvalue = pg_dist_shard.shardminvalue))
|
||||
)
|
||||
END AS own_node
|
||||
END AS has_separate_node
|
||||
FROM
|
||||
pg_dist_shard
|
||||
JOIN
|
||||
|
|
|
@ -15,7 +15,7 @@ SELECT
|
|||
CASE
|
||||
WHEN NOT pg_dist_shard.needsisolatednode THEN false
|
||||
ELSE
|
||||
-- own_node = true if the node doesn't have any other shards except the ones that are colocated with this shard
|
||||
-- has_separate_node = true if the node doesn't have any other shards except the ones that are colocated with this shard
|
||||
NOT EXISTS (
|
||||
-- get all the distributed table shards that are placed on the same node as this shard
|
||||
SELECT pds1.shardid
|
||||
|
@ -32,7 +32,7 @@ SELECT
|
|||
WHERE pdp1.colocationid = pg_dist_partition.colocationid AND
|
||||
((pds1.shardminvalue IS NULL AND pg_dist_shard.shardminvalue IS NULL) OR (pds1.shardminvalue = pg_dist_shard.shardminvalue))
|
||||
)
|
||||
END AS own_node
|
||||
END AS has_separate_node
|
||||
FROM
|
||||
pg_dist_shard
|
||||
JOIN
|
||||
|
|
|
@ -18,7 +18,7 @@ AS $func$
|
|||
DECLARE
|
||||
v_result boolean;
|
||||
BEGIN
|
||||
SELECT bool_and(own_node) INTO v_result
|
||||
SELECT bool_and(has_separate_node) INTO v_result
|
||||
FROM citus_shards
|
||||
JOIN (
|
||||
SELECT shardids FROM public.get_enumerated_shard_groups(qualified_table_name) WHERE shardgroupindex = shard_group_index
|
||||
|
@ -1185,7 +1185,7 @@ SELECT public.verify_placements_in_shard_group_isolated('isolate_placement.dist_
|
|||
SELECT DISTINCT(table_name::regclass::text)
|
||||
FROM citus_shards
|
||||
JOIN pg_class ON (oid = table_name)
|
||||
WHERE relnamespace = 'isolate_placement'::regnamespace AND own_node
|
||||
WHERE relnamespace = 'isolate_placement'::regnamespace AND has_separate_node
|
||||
ORDER BY 1;
|
||||
table_name
|
||||
---------------------------------------------------------------------
|
||||
|
@ -1196,7 +1196,7 @@ ORDER BY 1;
|
|||
dist_post_concurrently_colocated
|
||||
(5 rows)
|
||||
|
||||
SELECT bool_or(own_node) = false
|
||||
SELECT bool_or(has_separate_node) = false
|
||||
FROM citus_shards
|
||||
JOIN (
|
||||
SELECT unnest(shardids) shardid
|
||||
|
|
|
@ -20,7 +20,7 @@ AS $func$
|
|||
DECLARE
|
||||
v_result boolean;
|
||||
BEGIN
|
||||
SELECT bool_and(own_node) INTO v_result
|
||||
SELECT bool_and(has_separate_node) INTO v_result
|
||||
FROM citus_shards
|
||||
JOIN (
|
||||
SELECT shardids FROM public.get_enumerated_shard_groups(qualified_table_name) WHERE shardgroupindex = shard_group_index
|
||||
|
@ -658,10 +658,10 @@ SELECT public.verify_placements_in_shard_group_isolated('isolate_placement.dist_
|
|||
SELECT DISTINCT(table_name::regclass::text)
|
||||
FROM citus_shards
|
||||
JOIN pg_class ON (oid = table_name)
|
||||
WHERE relnamespace = 'isolate_placement'::regnamespace AND own_node
|
||||
WHERE relnamespace = 'isolate_placement'::regnamespace AND has_separate_node
|
||||
ORDER BY 1;
|
||||
|
||||
SELECT bool_or(own_node) = false
|
||||
SELECT bool_or(has_separate_node) = false
|
||||
FROM citus_shards
|
||||
JOIN (
|
||||
SELECT unnest(shardids) shardid
|
||||
|
|
Loading…
Reference in New Issue