Query takes longer when cached

I have a query in Retool, it is a simple "List all contacts" query

SELECT
  *
FROM
  contacts
ORDER BY
  contacts.first_name ASC;

When I disable retool cache this query takes about 1.2s on average. But with cache enabled it can take anywhere from 2s - 17s. This seems to be happening on multiple queries, enabling cache typically doubled run time.

FWIW I notice this most on Monday mornings and it seems to level out over the week, but that is purely anecdotal.

Hi @kyleteal,

That is very odd that the caching changes the runtime that drastically. Could you share the performance panel from the debug console with me for the query running with caching on and with it turned off?

As well as the breakdown when you mouse over the time count of the query's run?

Hmmm, I am not sure if something changed in the last few weeks but cached seems to be better now, at least in my test the query ran 2x as fast. I will keep an eye on it. Thank you!

One other note, my performance tab looks much different from yours, not sure if that is a bug or not.

1 Like

Hi @kyleteal,

Great to hear that the caching is working better now!

I just realized that we deprecated that Performance visual that I had shared :sweat_smile:

Now the Performance tab will give users recommendations based on their app.