-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requestedwaiting for contributorWaiting for updates by the contributorWaiting for updates by the contributor
Description
We tried using this query below to generate 5+ million records with nanoid
, but got stuck by this error cannot start commands during a parallel operation
INSERT INTO __map_table__(old,new)
SELECT id, nanoid() FROM __old_table__;
we resolve this by introducing COST
lower than or equal to 50
...
RETURNS text -- A randomly generated NanoId String
LANGUAGE plpgsql
VOLATILE
PARALLEL SAFE
COST 10 -- added
...
I'm not an expert on this, so is this a legit solution to solve this kind of problem or is there another way?
If this is good enough, I'll create PR.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requestedwaiting for contributorWaiting for updates by the contributorWaiting for updates by the contributor