Im thinking of a way I could somehow dynamicly allocate maybe by using KV or smth but don't know if
Im thinking of a way I could somehow dynamicly allocate maybe by using KV or smth but don't know if its possible in any way
2/17/24, 7:42 PM
p.posted and p.retry but it's still scanning the whole table p. Is there anyway to reduce scanned rows of the query above? I'm running this query every minutes so everyday I'm wasting 10-20k scanned row. This table is going to grow much larger so the waste will be more significant
posted and retry, or two individual indexes?SELECT *
FROM categories
JOIN images_categories ON categories.id = images_categories.category_id
JOIN images ON images_categories.image_id = images.id; let result = await platform!.env.DB.prepare(
`SELECT *
FROM categories
JOIN images_categories ON categories.id = images_categories.category_id
JOIN images ON images_categories.image_id = images.id;
`
).all();CREATE INDEX post_posted_retry_idx ON post (posted, retry);