Forum Discussion

cike's avatar
cike
Champion
7 years ago

Different results for SELECT count(*) and SELECT * ... list size

Hi guys,

 

I'm a bit confused using APIv2, during some inconsistent results. I execute the following queries to build a custom component and I already tested the query in Studio's API Browser:

 

SELECT count(*) FROM messages WHERE board.id = 'tech-experts-blog' AND depth = 0 AND labels.text IN ('Sicherheit')
SELECT * FROM messages WHERE board.id = 'tech-experts-blog' AND depth = 0 AND labels.text IN ('Sicherheit')

The first query (selecting the count) returns a list size of 8, whereas the second query returns only a list size of 7.

The default label widget shows the correct count for each label (7 in this case).

 

Does anyone have any idea where these difference is coming from? Could it be a bug in Lihtium's API or a data issue?

 

Best regards,

Christian

  • cike-

     

    This could be REST API V2 issue. Please try the following call with API V1 to confirm, if you are getting 7 or 8 result.  We had the same discrepancy issue. This can be resolved by opening a ticket to lithium support.

     

    • cike's avatar
      cike
      Champion

      TariqHussain

      Thanks for these tips. Using APIv1 to get the information also returned inconsistent values.

      I am going to open a support ticket for this.

       

      Thanks and best regards,

      Christian

  • The root cause for this issue was an inconsistent index. After a re-indexing task by Lithium everything works as expected. :)