trigger SPI_exec count argument - Mailing list pgsql-hackers

From Michael Nacos
Subject trigger SPI_exec count argument
Date
Msg-id 407fa4640909020521q72e71e60o923bc5e991a6009f@mail.gmail.com
Whole thread Raw
Responses Re: trigger SPI_exec count argument
List pgsql-hackers
Hi all,<br /><br />I have been trying to improve the performance of a C trigger only to notice that the real bottleneck
wasthe SPI execution of dynamic SQL statements. I had been using SPI_exec(sql,0) until I tried SPI_exec(sql,1), since I
amtargeting exactly one row each time for writing. This simple change has made a huge difference (2s --> 60ms in
somecases), now the trigger execution time is consistent with the response times I get if I run the same SQL statements
byhand in psql. I am happy my code performs better, but is this something you would expect?<br /><br />regards,
Michael<br/> 

pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Adding \ev view editor?
Next
From: Greg Stark
Date:
Subject: Re: remove flatfiles.c