Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support __spqr__auto_distribution hint #802

Merged
merged 2 commits into from
Nov 11, 2024
Merged

Support __spqr__auto_distribution hint #802

merged 2 commits into from
Nov 11, 2024

Conversation

reshke
Copy link
Collaborator

@reshke reshke commented Nov 11, 2024

Also __spqr__distribution_key


db1=# \c spqr-console

		SPQR router admin console
	Here you can configure your routing rules
------------------------------------------------
	You can find documentation here
https://github.com/pg-sharding/spqr/tree/master/docs

psql (16.2 (Ubuntu 16.2-1.pgdg20.04+1), server console)
WARNING: psql major version 16, server major version 0.0.
         Some psql features might not work.
You are now connected to database "spqr-console" as user "reshke".
spqr-console=> show relations;
 Relation name | Distribution ID | Distribution key
---------------+-----------------+------------------
 t             | ds1             | ("i", identity)
 t22           | ds1             | ("i", identity)
(2 rows)

spqr-console=> \c db1
psql (16.2 (Ubuntu 16.2-1.pgdg20.04+1), server 15.4)
You are now connected to database "db1" as user "reshke".
db1=# create table t33(i int, j int)  /* __spqr__auto_distribution: ds1, __spqr__distribution_key: i  */;
CREATE TABLE
db1=# \c db1
psql (16.2 (Ubuntu 16.2-1.pgdg20.04+1), server 15.4)
You are now connected to database "db1" as user "reshke".
db1=# \c spqr-console

		SPQR router admin console
	Here you can configure your routing rules
------------------------------------------------
	You can find documentation here
https://github.com/pg-sharding/spqr/tree/master/docs

psql (16.2 (Ubuntu 16.2-1.pgdg20.04+1), server console)
WARNING: psql major version 16, server major version 0.0.
         Some psql features might not work.
You are now connected to database "spqr-console" as user "reshke".
spqr-console=> show relations;
 Relation name | Distribution ID | Distribution key
---------------+-----------------+------------------
 t             | ds1             | ("i", identity)
 t22           | ds1             | ("i", identity)
 t33           | ds1             | ("i", identity)
(3 rows)

spqr-console=>

@reshke reshke enabled auto-merge (squash) November 11, 2024 11:44
@reshke reshke merged commit 2c714e7 into master Nov 11, 2024
27 checks passed
@reshke reshke deleted the jiodewjiodewe branch November 16, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants