Posted on 2005-09-26
Posted by x@jwp.name
This is the first release announcement for Proboscis[1], the
PQueue based Green
Trunk implementation. It is a PostgreSQL driver/interface for
Python. Another
one? Well, yes and no. Proboscis is not libpq based, nor does
it primarily
produce a DB-API 2.0 interface(0.2 may include a layer for
DB-API 2.0 users).
The release news item can be found here[2].
This frontend features, in no particular order, the
following:
* Pure Python
* Green Trunk interface
* Thread safety
* Windows support
* Basic SSL support
* COPY TO/FROM support
* Protocol level prepared statements and cursors(Portals)
* Demand based cursor activity
* query and procedure methods (see Green Trunk
documentation)
* bytea transparency (hint: no need to escape when using
parameters)
* Wire Tap (asynchronous notifications)
* Automatic client encoding/decoding
Download it here[3].
Pure Python? It must be slow, no? Well, first, there is an
optional C
extension module to provide an optimization in one sensitive
area, so it's
not necessarily pure Python. As 1.0 approaches, other sensitive
areas may be
optimized as well.
So how slow or fast is it? The following are some simple
trials:
(The server and the client are on the same machine)
Copying,
COPY FROM Summary,
copied tuples: 50000
copied bytes: 2882981
duration: 2.186987
average tuple size(bytes): 57.000000
average KB per second: 1287.159045
average tuples per second: 22862.505244
COPY TO Summary,
copied tuples: 50000
duration: 2.299819
average KB per second: 1224.009372
average tuples per second: 21740.841414
(Warning: Without the C extension module, COPY TO's TPS will be
cut in half)
Querying,
INSERT Summary,
inserted tuples: 1000
total time: 1.903957
average tuples per second: 525.221976
(Note: Mass INSERT will likely be ~2-3x faster in version
0.2)
SELECT Summary,
looped: 51
read tuples: 1000
looptime: 0.323199
time reading tuples: 0.322262
loop overhead: 0.000937
average tuples per second: 3103.064739
(Warning: Without the C extension module, SELECT will lose
1000TPS)
While it is unlikely that these speeds will be seen in
practice, it does give
one an idea as to what this interface can do with simple
data.
For the quickest way to get started, see the Frontend sections
of the Quick
Start page[4]. For further help, sign-up and post questions to
the mailing
list[5].
[1] http://python.projects.postgresql.org/project/fe.html
[2] http://pgfoundry.org/forum/forum.php?forum_id=522
[3]
http://pgfoundry.org/frs/?group_id=1000094&release_id=315
[4] http://python.projects.postgresql.org/quick.html
[5] http://lists.pgfoundry.org/mailman/listinfo/python-general