Menu

#373 Handling of processed tuple counting in DMLs

Development Queue
open
5
2013-01-21
2013-01-21
Abbas Butt
No

Consider the case of a non FQSed INSERT for example.
The executor keeps track of # of tuples processed in es_processed member of EState structure. When a non-FQSed INSERT completes this member is increased once due to
estate->es_processed += rowcount
in HandleCommandComplete and once due to
(estate->es_processed)++
in ExecInsert. The result is that although only one row is inserted we get message as if two rows got inserted INSERT 0 2
Now consider the same INSERT case when it is FQSed. In this case the # of tuples processed is increased just once in HandleCommandComplete since ExecInsert is never called in this case and hence we get correct output i.e. INSERT 0 1
To handle this error in processed tuple counting we are currently using a variable non_fqs_dml which indicates whether a DML is FQSed or not.

We can improve this handling by using this mechanism.

HandleCommandComplete should set the number of processed rows in some member of RemoteQueryState. At the time of executing the RemoteQueryState, it can decide whether to pick up that member and stuff it in es_processed or just use es_processed.

Discussion


Log in to post a comment.