1
在一個簡單的分區表:,可以將提示優化用於分區嗎?
-- note: no records stored in base, only inheritors of base
create table base(
base_id bigint,
base_tp char(3) not null,
...);
create table base_abc(
base_id bigserial primary key,
base_tp default 'abc'
check(base_tp = 'abc'),
...
) inherits(base);
create table base_efg(
base_id bigserial primary key,
base_tp default 'efg'
check(base_tp = 'efg'),
...
) inherits(base);
如果其中一個查詢子句是在該使用base_tp
,例如,
select * from base where ... and base_tp='abc'
將9.2下的查詢進行優化,只選擇表base_abc
或是否會像目前一樣查詢base
,base_abc
和base_efg
?
很好的參考。似乎只是醫生的命令。謝謝! –