SELECT 1 - Query flood in Snowflake used by Retool

We are connecting Snowflake in retool and built our application - which is working great. Now we are seeing SELECT 1 query is being flooded in snowflake like Million times in short period.

Upon seeing we believe that Retool uses SELECT 1 query for polling, connection validation and health check. But no such documentation in Retool we have such. Could someone help and guide me why our retool service account is querying SELECT 1 like million times?

Hi @Mahesh_Nandam , thanks for reaching out! Retool does use SELECT 1 queries for Snowflake connection validation and health checks. That said, would you be able to come back to me on the below so I can investigate this further:

  1. Are you using Retool Cloud, or self-hosting Retool? If the latter, please can you confirm the Retool version you’re on.
  2. Are you able to confirm when exactly this behaviour started (rough timestamp and/or Retool version)?
  3. How are you authenticating the Salesforce resource? Are you using Retool’s OAuth app or a custom Oauth App?

Thank you!

1 Like

@milly - Here you go with details.

  1. We are using Retool cloud.
  2. Retool version - 3.300.4 - This SELECT 1 was been flagged when we see our Snowflake quarterly report. So I believe starting January.
  3. We are connecting Snowflake resource through Key pair.

Thank you! Retool Cloud is currently on version 3.366.0 (see attached). The Retool version you provided, 3.300.4, looks like a self-hosted Stable release version. I’m basing the following on the assumption you’re self-hosting Retool (on version 3.300.4):

Since you're using key pair authentication, there currently isn’t a way to reduce the frequency of these queries. There is an environment variable (SNOWFLAKE_VALIDATION_DISABLE_HEARTBEAT=true) that can disable the heartbeat for Snowflake connections, but this only applies to OAuth-based Snowflake resources, so it wouldn't help in your case.

Worth noting: even for customers on OAuth who have set that flag, SELECT 1 queries can still appear, as there's a separate connection validation path that the flag doesn't cover. So it wouldn't fully eliminate them regardless.

If reducing Snowflake query volume is a priority, moving to OAuth auth would at least give you access to that flag which may reduce the volume of SELECT 1queries. The trade-off here is fewer SELECT 1 queries vs. a higher risk of transient query failures from stale or expired-token connections, which users would experience as errors in their Retool apps.

@milly - In this case - may I know why SELECT 1 query is being running several times. Need confirmation with our setup on why it is flooding in running such query multiple times.