'Optimize a postgres query where data is limited by a column
I have a postgres table with a column archived(true/false). I have a usecase where I archive the data every month so now my 90% of data is archived=true.
When I query the table I only want to query on archive=false 99% of the time, it is taking time to execute because it does not use index when I make a join with other table or when I add multiple filters. Even if I force psql to use this index still I will not be able to make use of index on other columns when I am using filter.
I am struggling to understand how do you optimize such design so that your query is always fast.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
