[teiid-issues] [JBoss JIRA] (TEIID-5434) count(*) returns different nr of rows compared to normal select

Steven Hawkins (JIRA) issues at jboss.org
Tue Jul 31 10:16:00 EDT 2018


    [ https://issues.jboss.org/browse/TEIID-5434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13612732#comment-13612732 ] 

Steven Hawkins commented on TEIID-5434:
---------------------------------------

The join nodes are planned differently:

JoinNode(3) [Dependent] [ENHANCED SORT JOIN [SEMI] (SORT_DISTINCT/SORT)] [INNER JOIN] criteria=[convert(PatientID, long)=epa.PatientID] output=[]

JoinNode(1) [Dependent] [MERGE JOIN (SORT_DISTINCT/ALREADY_SORTED)] [INNER JOIN] criteria=[convert(PatientID, long)=epa.PatientID] output=[pa.ICUSessionID, DateTime, "Value"]

I'll see if that points to what could be the issue.

> count(*) returns different nr of rows compared to normal select
> ---------------------------------------------------------------
>
>                 Key: TEIID-5434
>                 URL: https://issues.jboss.org/browse/TEIID-5434
>             Project: Teiid
>          Issue Type: Bug
>    Affects Versions: 10.3.3
>            Reporter: Bram Gadeyne
>            Assignee: Steven Hawkins
>            Priority: Critical
>         Attachments: count_plan.txt, count_plan_debug_log.txt, count_plan_text.txt, select_plan.txt, select_plan_debug_log.txt, select_plan_text.txt
>
>
> Normal select return 162175 rows:
> {code:sql}
> select pa.ICUSessionID,11074, obr.DateTime, obr.varvalue, true, 15001866
> from tv_retrieve_observrec obr
> join kd_matric.ExtrPatICUAdmissions epa on epa.PatientID = obr.admissionid
> join kd_matric.PatICUAdmissions pa on pa.ICUSessionID = epa.ICUSessionID and pa.BatchID < 1152
> where obr.VariableID = 15001866;
> {code}
> count query return a count of 11573
> {code:sql}
> select count(*)
> from tv_retrieve_observrec obr
> join kd_matric.ExtrPatICUAdmissions epa on epa.PatientID = obr.admissionid
> join kd_matric.PatICUAdmissions pa on pa.ICUSessionID = epa.ICUSessionID and pa.BatchID < 1152
> where obr.VariableID = 15001866;
> {code}
> This was detected on a snapshot release of 10.3.3



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the teiid-issues mailing list