@@ -43,42 +43,11 @@ SELECT count(*) FROM github_users;
43
43
44
44
Recall that ` github_users ` is a distributed table, meaning its data is divided
45
45
between multiple shards. Hyperscale (Citus) automatically runs the count on all
46
- shards in parallel, and combines the results. To see it in action, let's
47
- temporarily enable remote logging and look at the queries running on shards.
48
-
49
- ``` sql
50
- -- reveal the per-shard queries behind the scenes
51
-
52
- SET citus .log_remote_commands TO on ;
53
-
54
- -- run the count again
55
-
56
- SELECT count (* ) FROM github_users;
57
- ```
58
-
59
- ```
60
- NOTICE: issuing SELECT count(*) AS count FROM public.github_events_102040 github_events WHERE true
61
- DETAIL: on server [email protected] :5432 connectionId: 1
62
- NOTICE: issuing SELECT count(*) AS count FROM public.github_events_102041 github_events WHERE true
63
- DETAIL: on server [email protected] :5432 connectionId: 1
64
- NOTICE: issuing SELECT count(*) AS count FROM public.github_events_102042 github_events WHERE true
65
- DETAIL: on server [email protected] :5432 connectionId: 1
66
-
67
- ... etc, one for each of the 32 shards
68
- ```
69
-
70
- The advanced Hyperscale (Citus) query planner can transform almost all
71
- PostgreSQL queries into tasks running across shards. Its broad SQL support
72
- means that applications written for PostgreSQL can use Hyperscale (Citus) with
73
- minimal modification.
46
+ shards in parallel, and combines the results.
74
47
75
48
Let's continue looking at a few more query examples:
76
49
77
50
``` sql
78
- -- hide the remote queries again
79
-
80
- SET citus .log_remote_commands TO off;
81
-
82
51
-- Find all events for a single user.
83
52
-- (A common transactional/operational query)
84
53
0 commit comments