B
B
beduin012021-08-27 13:29:41
PostgreSQL
beduin01, 2021-08-27 13:29:41

What is the best way to organize a pivot table?

I have a table with 50 million records. It has a section_name column.
It would be possible to make it a reference book, but I don’t know all its possible values ​​yet, so it’s probably better not to deal with normalization.

However, in the menu, I need to display all the unique values ​​from it. DISTINCT to do on it extremely long. It turns out you need some kind of table that is constantly recalculated.

Questions.
1. How are such tables correctly called? Consolidated? Estimated? ...
2. How good is MATERIALZED VIEW or is something else better?
3. What is the easiest mechanism for recalculating such tables?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question