11.8. 部份索引(partial index)
範例 11.1. 設定部分索引以排除常見值
CREATE TABLE access_log (
url varchar,
client_ip inet,
...
);CREATE INDEX access_log_client_ip_ix ON access_log (client_ip)
WHERE NOT (client_ip > inet '192.168.100.0' AND
client_ip < inet '192.168.100.255');SELECT *
FROM access_log
WHERE url = '/index.html' AND client_ip = inet '212.78.10.32';範例 11.2. 設定部分索引以排除不感興趣的值
範例 11.3. 設定部分唯一索引
Last updated
Was this helpful?