faster plpgsql in PostgreSQL 9.5 (first part)
The PL/pgSQL is important part of PostgreSQL. A implementation of plpgsql is terrible simple, what has two impacts (one positive, one negative).
- We are able to implement new features very simply - implementation of some new functionality like
ASSER
orRAISE WITH CONTEXT
needs only few hours. - Some usual features from other languages are missing or it its implementation is suboptimal. But there are significant progress in prepared PostgreSQL 9.5.
-- tested on PostgreSQL 9.4 (synthetic test, worst case) -- IO cast postgres=# do $$declare s numeric = 0; begin for i in 1..10000000 loop s := i; end loop; end $$; DO Time: 6708.727 ms -- enforced binary casts postgres=# do $$declare s numeric = 0; begin for i in 1..10000000 loop s := i::numeric; end loop; end $$; DO Time: 4738.093 ms
-- tested on PostgreSQL 9.5 postgres=# do $$declare s numeric = 0; begin for i in 1..10000000 loop s := i; end loop; end $$; DO Time: 3992.551 ms postgres=# do $$declare s numeric = 0; begin for i in 1..10000000 loop s := i::numeric; end loop; end $$; DO Time: 3693.739 msThere is still some overhead, but it is significantly less 30% versus 7.5%. Other positive - PostgreSQL is in this test about 30% faster (it is synthetic test, so reality should be different, but, the expectation so 9.5 will be faster than 9.4 is valid).
1 Comments:
I found so many interesting stuff in your blog especially its discussion. Libros ePub Download
Post a Comment
Subscribe to Post Comments [Atom]
<< Home