Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
[PATCH] Add missing type conversion functions for PL/Python - Mailing list pgsql-hackers
From
Haozhou Wang
Subject
[PATCH] Add missing type conversion functions for PL/Python
Date
January 31, 2018
09:57:12
Msg-id
CAL_NLpKXMwv2ewZbtvUzujZxMgUq++6TgNTFRnY4+Tcsx7+1GQ@mail.gmail.com
Whole thread
Raw
Responses
Re: [PATCH] Add missing type conversion functions for PL/Python
List
pgsql-hackers
Tree view
Hi All,
PL/Python already has different type conversion functions to
convert PostgreSQL datum to Python object. However, the conversion
functions from Python object to PostgreSQL datum only has Boolean,
Bytea and String functions.
In this patch, we add rest of Integer and Float related datatype conversion functions
and can increase the performance of data conversion greatly especially
when returning a large array.
We did a quick test about the performance of returning array in PL/Python:
The following UDF is used for test:
```
CREATE OR REPLACE FUNCTION pyoutfloat8(num int) RETURNS float8[] AS $$ return [x/3.0 for x in range(num)]
$$ LANGUAGE plpythonu;
```
The test command is
```
select count(pyoutfloat8(n));
```
The count is used for avoid large output, where n is the number of element in returned array, and the size is from 1.5k to15m.
Size of Array 1.5k | 15k | 150k | 1.5m | 15m |
Origin 2.324ms | 19.834ms | 194.991ms | 1927.28ms | 19982.1ms |
With this patch 1.168ms | 3.052ms | 21.888ms | 213.39ms | 2138.5ms |
All test for both PG and PL/Python are passed.
Thanks very much.
--
Regards,
Haozhou
Attachment
0001-Add-missing-type-conversion-functions-for-PL-Python.patch
pgsql-hackers
by date:
Previous
From:
Amit Kapila
Date:
31 January 2018, 09:29:31
Subject:
Re: Wait for parallel workers to attach
Next
From:
Kyotaro HORIGUCHI
Date:
31 January 2018, 10:09:09
Subject:
Re: [HACKERS] [PATCH] Improve geometric types
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies