MedicOneSystems / MedicOneSystems/livewire-datatables

Performance Issue with updatedSearch Method Causing Timeouts

Open
#608 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

The updatedSearch method in the Livewire Datatables component is fetching all records from the database when processing searches. This has the potential to cause significant performance problems, including database server timeouts and HTTP 504 errors, when handling large datasets.

Steps to Reproduce:

Use a datatable with a large number of records.
Utilize the search functionality.
Experience performance issues and potential timeouts or 504 errors.

Expected Behavior:
The search functionality should efficiently filter results without retrieving all records from the database, avoiding timeouts and ensuring a smooth user experience.

Actual Behavior:
The method updatedSearch currently retrieves all records, causing inefficiencies and server errors.

Possible Solution:
The updatedSearch method could be improved by using a paginated or scoped query to fetch only the necessary records.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the updatedSearch method in the Livewire Datatables component and inspect how its query is executed during searches. Reproduce the issue with a large dataset, then verify that searches filter or paginate records without fetching the full result set or causing timeouts.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.