I’m encountering very slow query issue, any way to check why? Already enabled smart place worker
I’m encountering very slow query issue, any way to check why? Already enabled smart place worker

rows_read vs how many rows you get back (or take a look at wrangler d1 insights and look for query efficiency) - chances are you're missing an index


persist-to flag on my worker and persist on my setupDevPlatform() configuration to point to the shared directory, but it seems that instead of Next using the same sqlite file that's already there, it just creates a new one in the same directory.next dev --turbopack instead of having to build my Next app every time using bunx @cloudflare/next-on-pages && wrangler pages dev


rows_readwrangler d1 insightspersist-topersistnext dev --turbopackbunx @cloudflare/next-on-pages && wrangler pages devwrangler d1 execute <databasename> --command"SELECT * FROM my-table" > my-table.sql or jsonwrangler d1 execute <databasename> --remote --file my-table.sql or jsonsqlite3 .path/to/miniflare/local/db.sqlite ".schema my-table"sqlite3 .path/to/miniflare/local/db.sqlite "SELECT
'INSERT INTO my-table (
key1,key2,etc...
) VALUES (' || quote(key1) || ', etc..
FROM my-table;" > my-table-import.sql {
"query": "select \"id\", \"food_id\", \"nutrient_id\", \"amount\", \"derivation_id\", \"created_at\", \"updated_at\", ? || \"_\" || \"food_id\" as \"foodId\" from \"food_nutrients\" \"foodNutrients\" where \"foodNutrients\".\"food_id\" in (?, ?, ?, ?)",
"avgRowsRead": 252,
"totalRowsRead": 504,
"avgRowsWritten": 0,
"totalRowsWritten": 0,
"avgDurationMs": 1.75905,
"totalDurationMs": 3.5181,
"numberOfTimesRun": 2,
"queryEfficiency": 0.9682539682539683
}