SPI Concurrency Precautions?

Поиск
Список
Период
Сортировка
От Tom Mercha
Тема SPI Concurrency Precautions?
Дата
Msg-id DB7PR05MB508322D30B743D57A9E77771F4160@DB7PR05MB5083.eurprd05.prod.outlook.com
обсуждение исходный текст
Ответы Re: SPI Concurrency Precautions? Problems with Parallel Execution ofMultiple CREATE TABLE statements  (Tom Mercha <mercha_t@hotmail.com>)
Список pgsql-hackers
Dear Hackers

I've been working on an extension and using SPI to execute some queries. 
I am in a situation where I have the option to issue multiple queries 
concurrently, ideally under same snapshot and transaction. In short, I 
am achieving this by creating multiple dynamic background workers, each 
one of them executing a query at the same time using 
SPI_execute(sql_string, ...). To be more precise, sometimes I am also 
opting to issue a 'CREATE TABLE AS <sql_query>' command, an SPI utility 
command.

I was however wondering whether I can indeed achieve concurrency in this 
way. My initial results are not showing much difference compared to a 
not concurrent implementation. If there would be a large lock somewhere 
in SPI implementation obviously this can be counterintuitive. What would 
be the precautions I would need to consider when working with SPI in 
this manner?

Thanks,
Tom



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: Unicode normalization SQL functions
Следующее
От: Alvaro Herrera
Дата:
Сообщение: pg_trigger.tgparentid