Get Page data and total in one query

Is it possible to get total and paging data in one query? Say I have 100 total rows and my output looks like

{
  "total": 100,
  "list": [1, 3, 5, 7, 10]
}

I tried to achieve this with a query like

MATCH (:User {uid: $uid})-[:R1]->(:Chat)<-[:R2]-(:Post)<-[:R3]-(u:User)
WHERE NOT EXISTS(u.someproperty)
WITH u.uid as uids, count(u) as total
skip 0 limit 5
RETURN {list: collect(uids), total: total}

OR

MATCH (:User {uid: $uid})-[:R1]->(:Chat)<-[:R2]-(:Post)<-[:R3]-(u:User)
WHERE NOT EXISTS(u.someproperty)
WITH count(u) as total, u
WITH u.uid as uids, total
skip 0 limit 5
RETURN {list: collect(uids), total: total}

but the result looks like this

{
  "total": 2,
  "list": [
    1
  ]
}
{
  "total": 3,
  "list": [
    4,
    3,
    6,
    7
  ]
}

I found this post from Stackoverflow that helps.

For my problem, it can be solved by splitting the Match clause.

MATCH (:User {uid: $uid})-[:R1]->(:Chat)<-[:R2]-(:Post)<-[:R3]-(u:User)
WHERE NOT EXISTS(u.someproperty)
WITH count(u) as total
MATCH (:User {uid: $uid})-[:R1]->(:Chat)<-[:R2]-(:Post)<-[:R3]-(u:User)
WHERE NOT EXISTS(u.someproperty)
WITH u.uid as uids, total
skip 0 limit 5
RETURN {list: collect(uids), total: total}

But I am not sure about the performance, is it better to execute two queries or is it better like the solution above.