pg-sharding / spqr

Stateless Postgres Query Router.
https://pg-sharding.tech
Other
937 stars 47 forks source link

Add new routing runtime option: __spqr__execute_on #818

Closed reshke closed 1 week ago

reshke commented 1 week ago

Similat to Greenplum's one, allowing for execute custom sql on shards

db1=# select count(1) from jp4;
 count
-------
    99
  1901
(2 rows)

db1=# select count(1) from jp4 /* __spqr__execute_on: sh1 */;
 count
-------
    99
(1 row)

db1=# select count(1) from jp4 /* __spqr__execute_on: sh2 */;
 count
-------
  1901
(1 row)

db1=# select count(1) from jp4 ;
 count
-------
    99
  1901
(2 rows)