this post was submitted on 10 Dec 2024
8 points (100.0% liked)

PostgreSQL

677 readers
1 users here now

The world's most advanced open source relational database

Project
Events
Podcasts
Related Fediverse communities

founded 2 years ago
MODERATORS
 

I'm doing an extension that creates a pool of named background workers. Happy to hear any feedback on this.

CREATE EXTENSION pg_worker_pool;
CALL worker_pool.submit('foo', 'create index myindex_1 on my_big_table (id)');
CALL worker_pool.submit('foo', 'create index myindex_1 on my_big_table (name)');
CALL worker_pool.submit('bar', 'create index otherindex_2 on other_big_table (author)');
CALL worker_pool.submit('bar', 'create index otherindex_2 on other_big_table (title)');

This will start two background workers, foo and bar. foo will create an indices on table my_big_table and bar on table other_big_table. foo and bar will run independently of each other, but all indices submitted to the same worker will be created in order.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here