1x0's avatar
Level 1

Pagination: count(id) instead of count(*)

Hi guys,

Is it possible in Laravel to change the pagination query (only in specific cases) from:

SELECT COUNT(*) AS aggregate...

To:

SELECT COUNT(id) AS aggregate...?

We're still running a Laravel 4.2 project. Select count(id) will be a bit more efficient for the database.

I couldn't find an answer to this question anywhere on the internet.

Thank you.

0 likes
2 replies
1x0's avatar
Level 1

Thanks! I'll look into it.

Please or to participate in this conversation.