SteemSQL : Using TxComments or Comments ?

in #steemsql7 years ago (edited)

I have recently started learning to use SteemSQL.

I am using this post from @joythewanderer as example but one question makes me scratch my head tonight. I hope someone here could help me.

In the post mentioned earlier, joy lists all her articles, totaling to 250.
She uses the following SQL query (slithly modified):

select a.author, a.parent_permlink, a.title, a.timestamp, a.permlink
from TxComments a
inner join 
    (select permlink,
         min(tx_id) as tx_id
     from TxComments 
     where author = 'joythewanderer' and title <> ''
     group by permlink
    ) as b
on a.tx_id = b.tx_id and
    a.permlink = b.permlink
order by a.timestamp desc

During my reading I found out that the Comments table should be enough to perform this request way faster (above query takes 45 seconds approx.).

So I made this simple request:

SELECT
  Comments.author, Comments.parent_permlink, Comments.title, Comments.created, Comments.url
FROM Comments
WHERE author IN ( 'joythewanderer' ) 
AND title <> ''
ORDER BY created DESC

As expected, this request is way faster (40~100ms).
However total # of entries with that query only totals for 237.

I tracked the missing entries which are indeed an existing post, here is an example.

https://steemit.com/funny/@joythewanderer/out-of-power-out-of-favour

Apparently the missing posts are all located in the same time period (25 January, 2017 to 21 March 2017).

I guess I am missing something. Any clue ?