Have you tried just hitting the base table and indexes directly, either through plain views or just direct SQL?
I have tried each. The performances are worst querying on a subset (the views) than querying on whole huge table when using the huge indexes
=> this is the solution I am implementing. (800 is not true, but in 10 years it maybe will be)
Actually, I have added a boolean column on the huge table for each views. This is the way each view is a subset of huge table (Create View as Select * FROM hugeTable WHERE columnX is true --etc 800 times). Then I create 800partials indexes on that column(create index...WHERE columnX is TRUE), for each view.
This works great as the query planer chooses the partials indexes when querying the little subset of the terrific table (potential 20bilion rows)
This is better than material views for some reasons :
- saves places on hard drive (columnX is boolean +same indexes - data for MatViews)
- saves time generating materialised views
This is quite more complicated because in the project, the number of view is increasing, and dynamic then :
- then adding new mat views is simple
- adding new views => adding new column on the huge table. It can take long time to update boolean for each tuple. Then I need to truncate/bulk load all data each time I add a new View. Other problem is dynamic number column table was a bit tricky to implement in an ETL soft such Talend, but the benefits are I hope great.