lightdash icon indicating copy to clipboard operation
lightdash copied to clipboard

Athena connector: support ResultReuseConfiguration to enable query result caching

Open malyushkin opened this issue 7 months ago • 2 comments

Description

Amazon Athena supports query result reuse — repeated identical queries can return cached results instantly, avoiding unnecessary scan costs. However, this feature must be explicitly enabled per query via a ResultReuseConfiguration block in the StartQueryExecution API call. If this block is omitted, Athena defaults to Enabled: false.

Currently, the Lightdash Athena connector does not include ResultReuseConfiguration in its query execution calls, meaning result caching is never activated.

Proposed solution

Add support for ResultReuseConfiguration in the Athena connector's query execution call. This could be exposed as an optional connection-level setting, for example:

{
  "ResultReuseConfiguration": {
    "ResultReuseByAgeConfiguration": {
      "Enabled": true,
      "MaxAgeInMinutes": 60 * 5
    }
  }
}

When not configured, the connector should continue its current behaviour (no block sent, caching disabled).

What problem does this solve?

  • Cost — without result reuse, every Lightdash query scans data in S3 even when results are identical to a recent execution, leading to unnecessary charges.
  • Performance — cached results are returned in milliseconds vs. seconds or minutes for a full scan, which significantly improves dashboard load times.

malyushkin avatar Apr 14 '26 08:04 malyushkin

PROD-6955

linear[bot] avatar Apr 14 '26 08:04 linear[bot]

Thanks for sharing @malyushkin.

jesshitchcock avatar Apr 14 '26 08:04 jesshitchcock