How to Identify and Tune a Problematic Query with SQL EXPLAIN

As a developer, you are often faced with the question: why is my application slow? You may have already identified the database as the bottleneck (even this process can take some troubleshooting), and you then find yourself asking: Which queries are slow? Which queries should I be troubleshooting?  The query troubleshooting journey starts by first […]

As a developer, you are often faced with the question: why is my application slow? You may have already identified the database as the bottleneck (even this process can take some troubleshooting), and you then find yourself asking:
Which queries are slow? Which queries should I be troubleshooting?  The query troubleshooting journey starts by first isolating the offending query that is issued by your application. Step 0: Tag (label) your application when connecting to the database It is best practice to tag your application with a label or name when connecting to your database, enabling you to track the source of incoming queries.
Source: CockroachDB