5 Replies
Why do you need a
countDistinct
?wouldnt count distinct be what you want in most cases?
Not if you're counting unique ids
It's adding overhead for nothing
Anyway, that looks good to me
You could use
.then()
which would be basically the same thing
Also, if it's a unique id, you can just do count()
because every row will have an iddoes
count()
implicitly take in the primary key as the argcount()
returns count(*)
on the database
And that counts every row performantly