Re: [HACKERS] psql - add special variable to reflect the last query status - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: [HACKERS] psql - add special variable to reflect the last query status
Date
Msg-id CAFj8pRDKxFqGWjFr+UJjUsJ4R8kA2i8vB_TymxdPozB6tew+jg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] psql - add special variable to reflect the last querystatus  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] psql - add special variable to reflect the last querystatus
List pgsql-hackers
Hi

2017-09-06 11:14 GMT+02:00 Fabien COELHO <coelho@cri.ensmp.fr>:

Here is a version 6.

Small v7 update, sorry for the noise.

Add testing the initial state of all variables.

Fix typos in a comment in tests.

Fix the documentation wrt the current implementation behavior.

I rechecked last patch

There is not any issue with patching. All regress tests passed

I checked performance - the most fast queries are execution of simple prepared statement

prepare x as select 1;
-- 1000000 x
execute x;
execute x;
execute x;
execute x;

## patched
[pavel@nemesis postgresql]$ time psql -At -1 postgres -f ~/xxx.sql > /dev/null

real 0m44,887s
user 0m11,703s
sys 0m6,942s

This is probably the most worst case, what is possible and see some slowdown - in this case there is about 10% slowdown - 

but it is pretty untypical - the one query was less than 50 microsec. When there will be any IO activity or network usage, than this patch doesn't create any significant overhead.

I'll mark this patch as ready for commiter

Regards

Pavel
 


--
Fabien.

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Partition-wise join for join between (declaratively)partitioned tables
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] PoC plpgsql - possibility to force custom or generic plan