Skip to main content

Databases

Beta

This feature is currently in beta and is subject to change. If you are interested in testing it out, please reach out to us via Discord or email out support.

The database instruments allow measuring the performance of database queries directly in the CI. For each benchmark, information about the database queries is displayed in the CodSpeed dashboard. The following performance issues can be detected:

  • Un-optimized queries: queries that are not using indexes or are not using them efficiently
  • N+1 queries: queries that are executed multiple times for each item in a list instead of using a single query (coming soon)

Example of a benchmark with an un-optimized MongoDB query

The following benefits can be expected from using the database instruments:

  • Full visibility on the performance of your database queries, directly in the CI
  • Detect and fix problematic queries before they are deployed to production

How it works

When enabled, the CodSpeed Action will automatically spawn a proxy server that will intercept all database queries. Each query will be executed against a real database and the response sent back to the application.

For each query, the CodSpeed proxy will communicate with the real database to gather the explain plan and other metrics about it. When the run is finished, the data is sent to CodSpeed where it is processed.

Supported Databases

Support for the following databases is planned and will be available soon:

  • PostgreSQL
  • MySQL
  • SQLite
note

If there is another database you would like to see supported, please reach out to us via Discord or email out support.