本篇內(nèi)容主要講解“怎么使用PostgreSQL 12的settings選項(xiàng)”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“怎么使用PostgreSQL 12的settings選項(xiàng)”吧!
專業(yè)公司可以根據(jù)自己的需求進(jìn)行定制,成都網(wǎng)站建設(shè)、做網(wǎng)站構(gòu)思過程中功能建設(shè)理應(yīng)排到主要部位公司成都網(wǎng)站建設(shè)、做網(wǎng)站的運(yùn)用實(shí)際效果公司網(wǎng)站制作網(wǎng)站建立與制做的實(shí)際意義PostgreSQL 12為explain命令提供了settings選項(xiàng),可查看影響執(zhí)行計(jì)劃的設(shè)置修改.
測試數(shù)據(jù):
testdb=# drop table if exists t_settings; NOTICE: table "t_settings" does not exist, skipping DROP TABLE testdb=# create table t_settings(id int,c1 varchar(20)); CREATE TABLE testdb=# testdb=# insert into t_settings select x,'c1'||x from generate_series(1,100000) as x; INSERT 0 100000 testdb=# create index idx_t_settings_id on t_settings(id); CREATE INDEX
PG 11
testdb=# explain (settings on) select * from t_settings where id = 1; ERROR: unrecognized EXPLAIN option "settings" LINE 1: explain (settings on) select * from t_settings where id = 1; ^
PG 11不支持該特性.
PG 12
PG 12新增了該特性
[local]:5432 pg12@testdb=# explain (settings on) select * from t_settings where id = 1; QUERY PLAN ----------------------------------------------------------------------------------- Bitmap Heap Scan on t_settings (cost=12.17..570.66 rows=500 width=62) Recheck Cond: (id = 1) -> Bitmap Index Scan on idx_t_settings_id (cost=0.00..12.04 rows=500 width=0) Index Cond: (id = 1) (4 rows) Time: 5.403 ms
修改參數(shù),查看執(zhí)行計(jì)劃
[local]:5432 pg12@testdb=# set enable_indexscan=off; SET Time: 0.555 ms [local]:5432 pg12@testdb=# explain (settings on) select * from t_settings where id = 1; QUERY PLAN -------------------------------------------------------------------------------- Bitmap Heap Scan on t_settings (cost=4.30..8.31 rows=1 width=11) Recheck Cond: (id = 1) -> Bitmap Index Scan on idx_t_settings_id (cost=0.00..4.30 rows=1 width=0) Index Cond: (id = 1) Settings: enable_indexscan = 'off' (5 rows) Time: 0.759 ms
注意執(zhí)行計(jì)劃中的” Settings: enable_indexscan = ‘off’ “,把影響執(zhí)行計(jì)劃的參數(shù)修改打印出來,這是一個(gè)pretty cool特性,增強(qiáng)了易用性.
到此,相信大家對“怎么使用PostgreSQL 12的settings選項(xiàng)”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
網(wǎng)頁名稱:怎么使用PostgreSQL12的settings選項(xiàng)-創(chuàng)新互聯(lián)
標(biāo)題URL:http://jinyejixie.com/article42/djsjhc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機(jī)網(wǎng)站建設(shè)、云服務(wù)器、標(biāo)簽優(yōu)化、網(wǎng)站策劃、網(wǎng)站制作、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容