[postgis-devel] Postgis topology creation - O(n-squared)? - creates problems with large datasets.

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jan 10 13:04:06 PST 2014


On 1/10/2014 3:40 PM, Graeme B. Bell wrote:
> OK, I'm assuming that since this is a database list the word transaction carries a certain formal weight.
>   e.g.
>
> "In PostgreSQL, a transaction is set up by surrounding the SQL commands of the transaction with BEGIN and COMMIT commands."
> http://www.postgresql.org/docs/8.3/static/tutorial-transactions.html
>
> I agree that normal postgres commands carry much of the function of a transaction.

Hi Graeme,

Yes, in postgresql a "transaction" is a collection of statements that 
get executed and the results either get committed for all of the 
collection or non of it in the case of an error or explicit ROLLBACK. 
This is a feature that allow you to keep the database in a know clean 
state. There are also some side effects of this, like the fact that 
other processes can not see the intermediate result of a tranasaction in 
process until it has been committed so they don't get weird intermediate 
or incomplete results when running a query.

It is a little less obvious that all the work done in a function call is 
also done in the context of a transaction. So when you call a function 
like say ST_CreateTopoGeo(...) that this is implicitly run inside a 
transaction.

Transactions in general have some impact on performance and memory usage 
to support this behavior.

-Steve



More information about the postgis-devel mailing list