When running Supabase locally using the CLI (v1.187.3), there's a significant delay between the actual query execution time and the observed time in the application. For instance, an update query that takes 0.140 ms to execute (according to EXPLAIN ANALYZE) is taking about 72 seconds in the application.
Additional Notes:
The issue occurs with all types of queries (select, insert, update)
Tried both enabling and disabling db.pooler, no significant difference
Tested on both Docker Desktop and Rancher Desktop
To Reproduce
Steps to reproduce the behavior:
Set up a local Supabase instance using CLI v1.187.3
Run supabase start
Execute a simple update query in your application
Observe the time taken for the query execution
Expected behavior
The query execution time in the application should be close to the actual execution time reported by EXPLAIN ANALYZE (milliseconds, not seconds).
Screenshots
~If applicable, add screenshots to help explain your problem.~
System information
Rerun the failing command with --create-ticket flag.
LOG Start time (User): 4787866.071666
LOG End time (User): 4816994.7515
LOG Time taken (User): 29128.679833999835
LOG Start time: 4816995.05275
LOG End time: 4889937.893708
LOG Time taken: 72942.84095800016
LOG [{"avatar_url": null, "id": "ed007d8a-c34f-4c66-8199-d919c5b35f69", "preferred_name": "Tharaka De Silva", "updated_at": "2024-07-29T21:35:51.337524+00:00"}]
LOG null
EXPLAIN ANALYZE Query:
explain analyze
update profiles
set preferred_name = 'Raka'
where id = 'ed007d8a-c34f-4c66-8199-d919c5b35f69';
Result:
| QUERY PLAN |
| ----------------------------------------------------------------------------------------------------------------------------- |
| Update on profiles (cost=0.15..8.17 rows=0 width=0) (actual time=0.075..0.075 rows=0 loops=1) |
| -> Index Scan using profiles_pkey on profiles (cost=0.15..8.17 rows=1 width=38) (actual time=0.007..0.008 rows=1 loops=1) |
| Index Cond: (id = 'ed007d8a-c34f-4c66-8199-d919c5b35f69'::uuid) |
| Planning Time: 0.189 ms |
| Execution Time: 0.140 ms |
Sorry folks, this was me not using a useEffect when loading some data and that was causing some stress on the database 😓. Once I fixed my bad code, things are working as expected again.
Describe the bug
When running Supabase locally using the CLI (v1.187.3), there's a significant delay between the actual query execution time and the observed time in the application. For instance, an update query that takes 0.140 ms to execute (according to EXPLAIN ANALYZE) is taking about 72 seconds in the application.
Additional Notes:
To Reproduce Steps to reproduce the behavior:
Expected behavior
The query execution time in the application should be close to the actual execution time reported by EXPLAIN ANALYZE (milliseconds, not seconds).
Screenshots ~If applicable, add screenshots to help explain your problem.~
System information Rerun the failing command with
--create-ticket
flag.Additional context If applicable, add any other context about the problem here.
Code Sample:
Console Output of Above:
EXPLAIN ANALYZE Query:
Result: