wait you can delete dbs while they're still bound? sounds like a bug
wait you can delete dbs while they're still bound? sounds like a bug
For example if my LIMIT was 100 I would expect 100 rows_read without the order,That's not correct. SQLite has to read rows of its indexes as well to figure out which rows you want. It's very rare that your
LIMIT will be the total number of rows the actual SQLite query will process. Keep in mind, indexes do count as rows read/written themselves too.EXPLAIN and see what SQLite tells you will do, you can do this in the D1 Console UI too. This is the most reliable way to see what index you are missing.
Does a DO SQLite db not lock the entire database too though?
select * from sqlite_master ?_cf_KV and sqlite_sequence are also listed
CREATE INDEX idx_magnetograms_timestamp ON magnetograms(timestamp)sensors and another table of data, where data stores sensor_id, an index on that column speeds up queries like SELECT * FROM data WHERE sensor_id = ?CREATE INDEX idx_data_sensor_id_timestamp_desc ON data(sensor_id, timestamp DESC)LIMITEXPLAINselect * from sqlite_master_cf_KVsqlite_sequence{
"query": "delete from \"magnetograms\" where (\"magnetograms\".\"timestamp\" < ? or \"magnetograms\".\"timestamp\" > ?)",
"avgRowsRead": 119275,
"totalRowsRead": 715650,
"avgRowsWritten": 119273,
"totalRowsWritten": 715638,
"avgDurationMs": 418.5989,
"totalDurationMs": 2511.5934,
"numberOfTimesRun": 6,
"queryEfficiency": 0
}CREATE INDEX idx_magnetograms_timestamp ON magnetograms(timestamp)sensorssensor_idSELECT * FROM data WHERE sensor_id = ?CREATE INDEX idx_data_sensor_id_timestamp_desc ON data(sensor_id, timestamp DESC)