Desejo examinar o conteúdo de um índice btree.
No entanto, cada uma das funções btree do pageinspect diz que "channel_status_pkey_index" não é um índice btree
A tabela fica assim:
CREATE TABLE public.channel_status (
partition_id int2 NOT NULL,
game public."game" NOT NULL,
channel_id int4 NOT NULL,
platform_partition int4 NOT NULL,
enabled bool NOT NULL,
modified timestamptz NOT NULL,
CONSTRAINT channel_status_pkey PRIMARY KEY (partition_id, game, channel_id, platform_partition)
)
PARTITION BY LIST (partition_id);
Ele cria automaticamente o índice btree na chave primária. Eu também criei um índice explícito
CREATE UNIQUE INDEX channel_status_pkey_index ON ONLY public.channel_status USING btree (partition_id, game, channel_id, platform_partition)
Mas se eu executar qualquer função btree, ela falhará, não importa se eu uso channel_status_pkey
or channel_status_pkey_index
, com `public'. prefixo ou sem:
# SELECT * FROM bt_metap('public.channel_status_pkey_index');
ERROR: "channel_status_pkey_index" is not a btree index
Você tem uma ideia de por que o postgres afirma que o índice btree não é um índice btree?
Porque é um índice particionado , não um índice regular.
Semelhante às tabelas particionadas, os índices particionados não contêm nenhum dado, portanto não faria sentido usá-los com as funções do pageinspect. Os dados reais do índice são mantidos nas partições do índice, que são índices nas partições da tabela. Você deve usar as funções pageinspect com essas partições de índice.