Why use execution and current_execution? What's table 'current_execution' used for?

why use execution and current_execution ?

table ‘execution’ is used for workflow execution, but what 's table ‘current_exection’ used for ?

Within a namespace, Temporal guarantees there can be only a single running workflow exec with a specific workflowId.
“current_execution” table stores the run id for that current execution (for a specific workflow id and namespace id). It can be used to get the run id of currently running workflow (again per workflow id and namespace id).

Why you need to guarantee only a single running workflow (for a specific workflow id and namespaceid) at time ? Could you explain this reason ?

Why you need to guarantee only a single running workflow (for a specific workflow id and namespaceid) at time ? Could you explain this reason ?

The uniqueness of workflow by ID is an important guarantee that Temporal provides. It allows executing\ workflow business logic exactly once.

does client use policy id_reuse_reject_duplicate this important guarantee works ?

public enum WorkflowIdReusePolicy implements ProtocolMessageEnum {
    WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED(0),
    WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE(1),
    WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY(2),
    WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE(3),
    UNRECOGNIZED(-1);
}

WorkflowIdReusePolicy applies only when there is no currently open workflow with the same id. There is no way to have more than one open workflow with the same id independently of any policy.

thank you.