You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/postgresql/hyperscale/index.yml
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ metadata:
5
5
description: "Azure Database for PostgreSQL is a relational database service in the Microsoft cloud that is built for developers based on the open-source PostgreSQL database engine."
Copy file name to clipboardExpand all lines: articles/postgresql/hyperscale/quickstart-connect-psql.md
+38-14Lines changed: 38 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.service: postgresql
7
7
ms.subservice: hyperscale-citus
8
8
ms.custom: mvc, mode-ui
9
9
ms.topic: quickstart
10
-
ms.date: 01/24/2022
10
+
ms.date: 02/09/2022
11
11
---
12
12
13
13
# Connect to a Hyperscale (Citus) server group with psql
@@ -20,26 +20,50 @@ To follow this quickstart, you'll first need to:
20
20
21
21
## Connect
22
22
23
-
When you create your Azure Database for PostgreSQL server, a default database named **citus** is created. To connect to your database server, you need a connection string and the admin password.
23
+
When you create your Hyperscale (Citus) server group, a default database named **citus** is created. To connect to your database server, you need a connection string and the admin password.
24
24
25
-
1. Obtain the connection string. In the server group page, select the **Connection strings** menu item. (It's under **Settings**.) Find the string marked **psql**. It will be of the form, `psql "host=hostname.postgres.database.azure.com port=5432 dbname=citus user=citus password={your_password} sslmode=require"`
25
+
1. Obtain the connection string. In the server group page, select the
26
+
**Connection strings** menu item.
26
27
27
-
Copy the string. You’ll need to replace "{your\_password}" with the administrative password you chose earlier. The system doesn't store your plaintext password and so can't display it for you in the connectionstring.
3. At the prompt, connect to your Azure Database for PostgreSQL server with the [psql](https://www.postgresql.org/docs/current/app-psql.html) utility. Pass your connection string in quotes, being sure it contains your password:
32
-
```bash
33
-
psql "host=..."
34
-
```
34
+
* Copy the string.
35
+
* Replace "{your\_password}" with the administrative password you chose earlier.
36
+
* Notice the hostname starts with a `c.`, for instance
37
+
`c.demo.postgres.database.azure.com`. This prefix indicates the
38
+
coordinator node of the server group.
39
+
* The default dbname and username is `citus` and can't be changed.
40
+
41
+
2. Open the Azure Cloud Shell. Select the **Cloud Shell** icon in the Azure portal.
Copy file name to clipboardExpand all lines: articles/postgresql/hyperscale/quickstart-create-portal.md
+54-12Lines changed: 54 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,68 @@ ms.service: postgresql
7
7
ms.subservice: hyperscale-citus
8
8
ms.custom: mvc, mode-ui
9
9
ms.topic: quickstart
10
-
ms.date: 01/24/2022
10
+
ms.date: 02/09/2022
11
11
#Customer intent: As a developer, I want to provision a hyperscale server group so that I can run queries quickly on large datasets.
12
12
---
13
13
14
14
# Create a Hyperscale (Citus) server group in the Azure portal
15
15
16
-
Azure Database for PostgreSQL is a managed service that you use to run, manage, and scale highly available PostgreSQL databases in the cloud. This Quickstart shows you how to create an Azure Database for PostgreSQL - Hyperscale (Citus) server group using the Azure portal. You'll explore distributed data: sharding tables across nodes, ingesting sample data, and running queries that execute on multiple nodes.
16
+
Azure Database for PostgreSQL - Hyperscale (Citus) is a managed service that
17
+
you to run horizontally scalable PostgreSQL databases in the cloud. This
18
+
Quickstart shows you how to create a Hyperscale (Citus) server group using the
19
+
Azure portal. You'll explore distributed data: sharding tables across nodes,
20
+
generating sample data, and running queries that execute on multiple nodes.
17
21
22
+
## Prerequisites
18
23
19
-
Azure Database for PostgreSQL - Hyperscale (Citus) is a managed service that
20
-
you use to run, manage, and scale highly available PostgreSQL databases in the
21
-
cloud. Its [basic tier](concepts-server-group.md#tiers) is a convenient
22
-
deployment option for initial development and testing.
24
+
To follow this quickstart, you'll first need to:
25
+
26
+
* Create a [free account](https://azure.microsoft.com/free/) (If you don't have
27
+
an Azure subscription).
28
+
* Sign in to the [Azure portal](https://portal.azure.com).
29
+
30
+
## Create server group
31
+
32
+
1. Select **Create a resource** (+) in the upper-left corner of the portal.
33
+
2. Select **Databases** > **Azure Database for PostgreSQL**.
34
+

35
+
3. Select the **Hyperscale (Citus) server group** deployment option.
4. Fill out the **Basics** form with the following information:
38
+

39
+
40
+
| Setting | Description |
41
+
|-------------------|-------------------|
42
+
| Subscription | The Azure subscription that you want to use for your server. If you have multiple subscriptions, choose the subscription in which you'd like to be billed for the resource. |
43
+
| Resource group | A new resource group name or an existing one from your subscription. |
44
+
| Server group name | A unique name that identifies your Hyperscale server group. The domain name postgres.database.azure.com is appended to the server group name you provide. The server can contain only lowercase letters, numbers, and the hyphen (-) character. It must contain fewer than 40 characters. |
45
+
| Location | The location that is closest to you. |
46
+
| Admin username | Currently required to be the value `citus`, and can't be changed. |
47
+
| Password | A new password for the server admin account. It must contain between 8 and 128 characters. Your password must contain characters from three of the following categories: English uppercase letters, English lowercase letters, numbers (0 through 9), and non-alphanumeric characters (!, $, #, %, etc.). |
48
+
| Version | The latest PostgreSQL major version, unless you have specific requirements. |
49
+
| Compute + storage | The compute, storage, and Tier configurations for your new server. Select **Configure server group**. |
50
+
51
+

52
+
53
+
5. For this quickstart, you can accept the default value of **Basic** for
54
+
**Tiers**. The other option, standard tier, creates worker nodes for
55
+
greater total data capacity and query parallelism. See
56
+
[tiers](concepts-server-group.md#tiers) for a more in-depth comparison.
57
+
6. Select **Next : Networking >** at the bottom of the screen.
58
+
7. In the **Networking** tab, select **Allow public access from Azure services
59
+
and resources within Azure to this server group**.
Copy file name to clipboardExpand all lines: articles/postgresql/hyperscale/quickstart-distribute-tables.md
+76-45Lines changed: 76 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,25 +7,24 @@ ms.service: postgresql
7
7
ms.subservice: hyperscale-citus
8
8
ms.custom: mvc, mode-ui
9
9
ms.topic: quickstart
10
-
ms.date: 01/24/2022
10
+
ms.date: 02/09/2022
11
11
---
12
12
13
-
# Create and distribute tables
13
+
# Model and load data
14
14
15
-
Within Hyperscale (Citus) servers there are three types of tables:
15
+
Within Hyperscale (Citus) servers, there are three types of tables:
16
16
17
17
***Distributed Tables** - Distributed across worker nodes (scaled out).
18
-
Generally large tables should be distributed tables to improve performance.
18
+
Large tables should be distributed tables to improve performance.
19
19
***Reference tables** - Replicated to all nodes. Enables joins with
20
20
distributed tables. Typically used for small tables like countries or product
21
21
categories.
22
22
***Local tables** - Tables that reside on coordinator node. Administration
23
23
tables are good examples of local tables.
24
24
25
-
In this quickstart, we'll primarily focus on distributed tables, and getting
26
-
familiar with them.
27
-
28
-
The data model we're going to work with is simple: user and event data from GitHub. Events include fork creation, git commits related to an organization, and more.
25
+
In this quickstart, we'll focus on distributed tables, and get familiar with
26
+
them. The data model we're going to work with is simple: an HTTP request log
27
+
for multiple websites, sharded by site.
29
28
30
29
## Prerequisites
31
30
@@ -37,73 +36,105 @@ To follow this quickstart, you'll first need to:
37
36
38
37
## Create tables
39
38
40
-
Once you've connected via psql, let's create our tables. In the psql console run:
39
+
Once you've connected via psql, let's create our table. Copy and paste the
40
+
following commands into the psql terminal window, and hit enter to run:
41
41
42
42
```sql
43
-
CREATETABLEgithub_events
43
+
CREATETABLEgithub_users
44
44
(
45
-
event_id bigint,
46
-
event_type text,
47
-
event_public boolean,
48
-
repo_id bigint,
49
-
payload jsonb,
50
-
repo jsonb,
51
-
user_id bigint,
52
-
org jsonb,
53
-
created_at timestamp
45
+
user_id bigint,
46
+
url text,
47
+
login text,
48
+
avatar_url text,
49
+
gravatar_id text,
50
+
display_login text
54
51
);
55
52
56
-
CREATETABLEgithub_users
53
+
CREATETABLEgithub_events
57
54
(
58
-
user_id bigint,
59
-
url text,
60
-
login text,
61
-
avatar_url text,
62
-
gravatar_id text,
63
-
display_login text
55
+
event_id bigint,
56
+
event_type text,
57
+
event_public boolean,
58
+
repo_id bigint,
59
+
payload jsonb,
60
+
repo jsonb,
61
+
user_id bigint,
62
+
org jsonb,
63
+
created_at timestamp
64
64
);
65
-
```
66
-
67
-
The `payload` field of `github_events` has a JSONB datatype. JSONB is the JSON datatype in binary form in Postgres. The datatype makes it easy to store a flexible schema in a single column.
68
65
69
-
Postgres can create a `GIN` index on this type, which will index every key and value within it. With an index, it becomes fast and easy to query the payload with various conditions. Let's go ahead and create a couple of indexes before we load our data. In psql:
CREATEINDEXpayload_indexON github_events USING GIN (payload jsonb_path_ops);
74
68
```
75
69
76
70
## Shard tables across worker nodes
77
71
78
-
Next we’ll take those Postgres tables on the coordinator node and tell Hyperscale (Citus) to shard them across the workers. To do so, we’ll run a query for each table specifying the key to shard it on. In the current example we’ll shard both the events and users table on `user_id`:
72
+
Next, we’ll tell Hyperscale (Citus) to shard the tables. If your server group
73
+
is running on the Standard Tier (meaning it has worker nodes), then the table
74
+
shards will be created on workers. If the server group is running on the Basic
75
+
Tier, then the shards will all be stored on the coordinator node.
76
+
77
+
To shard and distribute the tables, call `create_distributed_table()` and
0 commit comments