Re: Extended query: prepared statements list?

From: "M(dot) Bastin" <marcbastin(at)mindspring(dot)com>
To: Oliver Fromme <olli(at)lurza(dot)secnetix(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Extended query: prepared statements list?
Date: 2004-07-15 18:28:08
Message-ID: a06110400bd1c7622ce7b@[192.168.0.101]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Oliver,

> > I only wish there were more documentation about the extended query
> > language. All I've found on the whole internet would hold on 2 to 3
> > printed pages. Did I miss something?)
>
>I'm not sure what exactly you are missing, but the page
>documenting the PREPARE statement (in the official Postgres
>docs) pretty much says it all. Also, it's easy to find
>(Docs -> Reference -> SQL Commands -> PREPARE).
>
>http://www.postgresql.org/docs/7.4/static/sql-prepare.html
>
>However, maybe we're actually talking about completely
>different things

Yes and no. I'm looking at the subject from the frontend-backend
protocol 3.0 point of view which is separated in the Extended Query
language and the Simple Query language.

With the PREPARE and EXECUTE statements you're accessing the Extended
Query language through the Simple Query language, which requires more
CPU time since your EXECUTE query itself is going to be parsed as a
Simple Query first before PostgreSQL realizes it must execute a
prepared statement, while when you send the commands directly through
the Extended Query language you skip that parsing step.

Plus the Extended Query language is far richer than just preparing
and executing even though these 2 operations will probably cover most
needs. The Extended Query language is also much more complex to use.
E.g. you would do the EXECUTE by issuing about 5 commands--but it's
still much faster. That's where I had problems and wished for more
documentation and/or examples.

I hope this clears up the confusion.

Cheers,

Marc

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Felix E. Klee 2004-07-15 18:29:02 Re: Critique needed for contact-DB draft
Previous Message Felix E. Klee 2004-07-15 18:24:12 Re: Critique needed for contact-DB draft