Skip to content

Dashboard::SnippetsController#index is very slow due to SQL

Loading snippets dashboard takes >10s for me. According to performance bar, finding the snippets is the problematic part that takes most of the time.

From our daily statistics:

  • 720 requests (rarely used) per 24h
  • 98.9% of time spent in SQL

SQL timings per request:

  • Mean: 5.11s
  • p95: 23.42s
  • p99: 25.66s

Many requests for this action are likely to get canceled as they go beyond statement_timeout=15s. While this is a rarely used controller, it renders the snippets feature unusable when it hits the timeout.

Edited by Andreas Brandl