Closed
Description
Description:
There's a significant performance issue when executing a specific query using the Laravel driver for SingleStore. The query runs much slower compared to executing it directly through the admin panel/TablePlus.
Steps to Reproduce:
- Set up the environment using the repository: https://github.com/nick-potts/laravel-verbs-singlestore
- Run
php artisan app:seed-events
to seed the database - Execute the following query using the Laravel driver:
select * from `verb_state_events` where `state_id` = 196875813868675074 and `state_type` = 'App\\States\\CustomerState' order by `id` asc limit 1000
Expected Behavior:
The query should execute quickly, similar to when run directly in SingleStore Studio or CLI.
Actual Behavior:
- The query takes approximately 3.5 seconds to complete when run through the Laravel driver.
- The issue persists in both production and local Docker SingleStore environments.
Additional Observations:
- The performance issue only occurs when using the Laravel driver.
- Changing the query from
order by `id` asc
toorder by id asc
(removing backticks) reduces execution time from 3.5s to 4ms. - Removing the asc (despite the table being asc ordered by default) also fixes it.
- Dumping and re-importing the table does not reproduce the issue, suggesting a possible sharding/segment related problem.
Environment:
- SingleStore version: 8.7.3 (local), 8.5.5 (production)
Additional Notes:
- Enabling auto profiling seems to "fix" the issue, with query execution time dropping to 20ms.
- The issue appears to be more pronounced under concurrent load, potentially due to CPU constraints.
Metadata
Metadata
Assignees
Labels
No labels