Re: MySQL HandlerSocket - Is this possible in PG?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Michael Ben-Nes <michael(at)epoch(dot)co(dot)il>
Cc: PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: MySQL HandlerSocket - Is this possible in PG?
Date: 2010-12-21 15:50:51
Message-ID: AANLkTikphG0OESWH7wzXpPjP6i1zAUwM9-DbfLbUNAXU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2010/12/21 Michael Ben-Nes <michael(at)epoch(dot)co(dot)il>:
> Hi Pavel,
>
> Thanks for your quick answer. Can you please elaborate a bit more about the
> points bellow.
>
> On Tue, Dec 21, 2010 at 1:31 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>>
>> Hello
>>
>> you can emulate it now.
>>
>> a) try to do a simple stored procedure, where you can wrap your query
>
> Do you mean I should use PREPARE?

yes

>
>> b) use a FAST CALL API to call this procedure
>
> Currently I use PHP to access the DB which use libpq. Is that cosidered a
> fast call API ? if not, can you please refer me to the right info.
>
>>

sorry it is a fast-path interface

http://www.postgresql.org/docs/8.1/static/libpq-fastpath.html

but php hasn't a adequate API :(

>> c) use a some pool tool for pooling and persisting sessions
>
> PHP pg_pconnect command open a persistent PostgreSQL connection. Is it
> enough or I better use PgPool2 or something similar?
>

probably it's enough

>
> Considering the points above, will I be able to get such high QPS from
> PostgreSQL ? If so, it will be my pleasure to dump Reddis and work solely
> with PG :)
>

There is a lot of unknown factors, but I believe so speed is limited
by IO more than by sw. The PostgreSQL engine isn't specially optimised
for access with primary key (InnoDB has this optimization, PostgreSQL
hasn't clustered index) , so probably Pg will be slower.

Regards

Pavel Stehule

>
> Thanks,
> Miki
>
>>
>> Regards
>>
>> Pavel Stehule
>>
>> 2010/12/21 Michael Ben-Nes <michael(at)epoch(dot)co(dot)il>:
>> > Hi,
>> >
>> > Just stumbled on the following post:
>> >
>> > http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html
>> >
>> > The post claim that MySQL can do more qps then MemCahed or any other
>> > NoSQL
>> > when doing simple queries like: SELECT * FROM table WHERE id=num;
>> >
>> > And I wonder if:
>> >
>> > 1. Currently, is it possbile to achive the same using PG 9.0.x
>> > 2. Is it possible at all?
>> >
>> > It seems to me that if such gain is possible, PG should benefit from
>> > that
>> > significantly when it comes to Key/Value queries.
>> >
>> >
>> > Best,
>> > Miki
>> >
>> >
>
> --------------------------------------------------
> Michael Ben-Nes - Internet Consultant and Director.
> http://www.epoch.co.il - weaving the Net.
> Cellular: 054-4848113
> --------------------------------------------------
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mladen Gogala 2010-12-21 19:28:46 Performance of PostgreSQL over NFS
Previous Message Kevin Grittner 2010-12-21 15:44:15 Re: Query uses incorrect index