Use this tag for questions about improving the performance and/or efficiency of database queries.
Questions regarding query performance should use this tag. Be sure to include tags for the database type (oracle, sql-server, etc) and database version tags such as oracle-12c. If you are joining tables, you can include tags such as join or if you know what type of join you are using, include that, such as inner-join, outer-join, or full-outer-join,
Your question should include a minimal query that exhibits the issue, a description of the tables and their columns (including data types), an execution plan (if possible one that shows actual row counts, times, etc.) and what troubleshooting you have attempted such as hints and rewriting the query.
IF joining tables, list the approximate number of rows of each table and the cardinality of the join columns, such as "there are approximately 200
order_id values for a particular