'How to speed up processing time for postgres query that is using index scan?
I am currently having a problem with long sql processing with my application for certain queries that uses Django and postgres. Using the built in django.db.connections.queries I was able to see which queries were taking the longest. I have one more complicated query that joins together 12 different tables where the majority of the processing time is being spend
Using pgAdmin I was able to use the 'Explain Analyze' tool to see where the bottleneck seems to be.

Most of the time is spent with on Index Scans matching the table ids. Particularly a large chunk of time is spent in this nested loop inner join
I want to optimize this query, but since it is already using indexes, I am not sure how to do so.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

