Обсуждение: Organizing large child tables & indexes for quick seeking

Поиск
Список
Период
Сортировка

Organizing large child tables & indexes for quick seeking

От
Wells Oliver
Дата:
I have a parent table which at the moment has 140 child tables, each partitioned by year and week (named table_yr2018_wk25, etc). Each child table has something like 80-100m rows. 

Querying from the parent table can be a hit or miss operation: sometimes the planner does a sequence scan over each child table and its millions of rows (which of course never completes) and sometimes it uses an index: I have an index on each child table which is comprised of 5 columns, including week and year.

The PK on the parent table is a uuid.

Any tips here for ensuring a faster seek to the appropriate child table? Should I make an index that just has week/year?

--