contributte / contributte/datagrid

More efficient date filtering

Open
#517 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T: Feature
Dominant language
PHP
Stars
296
Forks
215
PR merge metrics
No merged PRs in 30d

Description

Right now, the database data-source implementations use following approach to filter by date:

WHERE DATE(column_name) = '2000-12-30'

This approach (at least for some databases) prevents to use defined table index on the column which can cause major performance issue on big tables. Suggested alternative approach:

WHERE (column_name >= '2000-12-30' AND column_name < '2000-12-31')

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 database data-source implementations that apply date filters and compare their generated SQL with the examples in this issue. Update the filtering approach so indexed date columns remain usable, then verify that each affected data source still matches the requested date and run the relevant test suite if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.