Re: [PROPOSAL] DIAGNOSTICS = SKIPPED_ROW_COUNT - Mailing list pgsql-hackers

From dinesh kumar
Subject Re: [PROPOSAL] DIAGNOSTICS = SKIPPED_ROW_COUNT
Date
Msg-id CALnrH7qdPhbSNmNySeW3Pb1HijwTQqW6rFG03QK=4J=oPn=q+A@mail.gmail.com
Whole thread Raw
In response to Re: [PROPOSAL] DIAGNOSTICS = SKIPPED_ROW_COUNT  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PROPOSAL] DIAGNOSTICS = SKIPPED_ROW_COUNT  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi Robert,
 
On Wed, Oct 14, 2015 at 12:56 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Tue, Oct 13, 2015 at 10:37 PM, dinesh kumar <dineshkumar02@gmail.com> wrote:
> In an existing wait policies like WAIT(default) and NO WAIT,
> one can be sure to determine(Using ROW_COUNT daignostics counter),
> how many required tuples he processed in a transaction.
> But this is not case when it comes to SKIP LOCKED.

Sure it is.  You didn't process the ones that you skipped.  This is no
different than if you say WHERE a = 5.  Depending on plan choice and
table contents, you may have "skipped" a large number of rows where a
!= 5, or you may have skipped none at all.
 
Yes, True.
 
But, using SKIP LOCKED we may bypass the tuples where a = 5, If those were locked by parallel operations.
 

> In my view, SKIP LOCKED is a nice feature, which gives only the available OR
> unlocked tuples.
> But those are not the complete required tuples for the given SQL statement.
> Isn't it ?!

They better be.
 
Agreed.
 
  If you wanted the locked tuples, you shouldn't have
asked to skip them.
 
Kindly let me know if I am going in a wrong way.
 
I see this feature as an add on to do the parallel DML operations.
There won't be any problem, if operations are mutually exclusive.
I mean, each session operates on unique set of tuples.
 
In the above case, we don't even need of SKIP LOCKED wait policy.
 
But, when it comes to mutually depend operations, isn't it nice to provide,
how much were locked by the other sessions. OR atlest a HINT to the other session like,
 
GET DIAGNOSTICS var = DID_I_MISS_ANYTHING_FROM_OTHER_SESSIONS;
 
I agree that, adding counter will take a performance hit.
Rather going to my actual proposal on providing the counter value,
isn't it good to provide a boolean type HINT, if we miss atleast a single tuple.
 
Let me know your thoughts.
 
Thanks in advance.
 

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--

pgsql-hackers by date:

Previous
From: kolo hhmow
Date:
Subject: Re: pam auth - add rhost item
Next
From: Peter Geoghegan
Date:
Subject: Re: More work on SortSupport for text - strcoll() and strxfrm() caching