Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Total Records #91

Closed
elogistical opened this issue Mar 5, 2023 · 2 comments
Closed

Skip Total Records #91

elogistical opened this issue Mar 5, 2023 · 2 comments

Comments

@elogistical
Copy link

elogistical commented Mar 5, 2023

Thanks for the great lib, one issue i think many of us having is processing large Mysql Data with joins in innoDB engine.
can you add something like this:
https://yajrabox.com/docs/laravel-datatables/master/skip-total-records

Skip total records aims to improve dataTables response time by skipping the total records count query and settings its value equals to the filtered total records.

I just tested and you can Re-Produce src/Datatables.php:243

`
$this->response['recordsTotal'] = $this->db->count($this->builder->filtered);

///REMOVE THIS BLOCK
if($this->builder->query->sql === $this->builder->filtered->sql) {
$this->response['recordsFiltered'] = $this->response['recordsTotal'];
} else {
$this->response['recordsFiltered'] = $this->db->count($this->builder->filtered);
}

////END REMOVE
`

@elogistical
Copy link
Author

Please review this issue

@elogistical elogistical reopened this Mar 5, 2023
@n1crack
Copy link
Owner

n1crack commented Apr 15, 2024

added with 2.3.8

@n1crack n1crack closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants