Re: Cluster table based on grand parent?
От | Adrian Klaver |
---|---|
Тема | Re: Cluster table based on grand parent? |
Дата | |
Msg-id | 28cfc94c-f778-548d-1159-e33627e44eec@aklaver.com обсуждение исходный текст |
Ответ на | Cluster table based on grand parent? (Dominique Devienne <ddevienne@gmail.com>) |
Ответы |
Re: Cluster table based on grand parent?
|
Список | pgsql-general |
On 3/28/23 06:17, Dominique Devienne wrote: > Hi again, > > Thanks for any insights. --DD > > PS: At this point, I don't even know how much cluster affects performance. > But because it can affect the schema structure (by denormalizing), > i'd rather know early. You will need to explain to me how it denormalizes? It reorders rows by index definition and does not maintain that order over updates and inserts. > > [1]: https://www.postgresql.org/docs/current/sql-cluster.html > <https://www.postgresql.org/docs/current/sql-cluster.html> > > ``` > dd=> create table parent (id int generated always as identity primary > key, name text not null unique); > CREATE TABLE > > dd=> create table child (id int generated always as identity primary > key, parent int not null references parent(id) on delete cascade, name > text not null, unique(parent, name)); > CREATE TABLE > > dd=> create table grandchild (id int generated always as identity > primary key, parent int not null references child(id) on delete cascade, > name text not null, unique(parent, name)); > CREATE TABLE > ``` -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления: