Re: execute same query only one time? - Mailing list pgsql-general

From Harald Fuchs
Subject Re: execute same query only one time?
Date
Msg-id 877fie6xao.fsf@hf.protecting.net
Whole thread Raw
In response to execute same query only one time?  (Johannes <jotpe@posteo.de>)
Responses Re: execute same query only one time?
List pgsql-general
Johannes <jotpe@posteo.de> writes:

>> What the reason to execute all statements which return different
>> columns at once?
>>
>>> Saving roundtrips,
>>
>> In most cases they are not so big. Getting a bunch of duplicated data
>> is wasting you network bandwidth and don't increase speed.
>
> In my and your example no duplicated data (result sets) is send over the
> network. The server do not need to wait until the client snips out the
> id and sends it id in the next query again. So the server can compute
> the result set without external dependencies as fast as possible.

Sounds like what you're really after is a stored procedure, isn't it?

pgsql-general by date:

Previous
From: Álvaro Hernández Tortosa
Date:
Subject: Re: JSONB performance enhancement for 9.6
Next
From: Алексей Митропольский
Date:
Subject: no pg_hba.conf entry for replication connection