Forum: Building VoltDB Applications

Post: about stored procedure to query a single replicated table

about stored procedure to query a single replicated table
Sep 1, 2017
Do I have to partition the procedure on another unnecessary partitioned table ? Otherwise, the procedure is multi-partitioned and have performance issues.(such as global lock)

Is this confirmed? Why can't voltdb analyze the procedure and find out only one replicated table is involved, so just pick any idle partition to execute it?

What's the recommended way to write a stored procedure to query a single replicated table?

Thanks in advance.

Sep 1, 2017
Hi Xiang,

If you are only reading from a replicated table in your stored procedure, VoltDB actually optimizes it to only run on a local partition without blocking any other partitions. However, the transaction will still be routed to the multi-partition coordinator.

If you want to avoid routing it to the multi-partition coordinator and have it balanced across different partitions, you can partition the procedure and specify a different partition value each time you invoke it. This is only necessary if you invoke this procedure a lot, otherwise there shouldn't be any performance issues because of the optimization we put into place.

Sep 3, 2017
Hi Ning,

Thank you very much for your prompt response.