"FERREIRA, William (VALTECH)" <william.ferreira@xxxxxxxxxx> writes: > My test document has 115000 nodes. > the export of the document(extracting all informations from database and writing XML file on disk) takes 30s with Oracle and 5mn with Postgresql. > The Oracle stored procedure is written in pl/sql and the Postgresql stored procedure in pl/perl (using spi_exec). So the test case involves 115000 executions of the same query via spi_exec? That means the query will be re-parsed and re-planned 115000 times. If you want something that's a reasonably fair comparison against Oracle, try plpgsql which has query plan caching. regards, tom lane PS: please do NOT post EXPLAIN VERBOSE output unless someone specifically asks for it. It clutters the archives and it's usually useless. EXPLAIN ANALYZE is what we normally want to see for performance issues.