Perf difference on prepared statements

Hey, I made the original post on the forum and just want to add some additional details:
I think my assumption that it wasn't caching at all was incorrect. The responses just seem to be a lot slower...

For example my worker with:
await sql`select 'hello' as "message";`

usually responds in 20-50ms whereas:
await sql`select ${'hello'} as "message";`

usually responds in 200-300ms.

The reason I say my assumption was incorrect is the cached percentage in my hyperdrive dashboard is now showing a high percentage, so it must be something to do with how the caching is working.

I've tried with both
prepare: false
and
prepare: true
and neither seem to make a big difference to the times...

Any help here would be appreciated! My app is able to cache a large percentage of the data, so I could see some serious performance gains if I can work out what's wrong.
Was this page helpful?