q scan or index scan - PostgreSQL random_page_cost
SQL Performance tuning - random_page_cost
cf. effective_cache_size
same as effective_cache_size, random_page_cost parameter controls PostgreSQL sql
cost planning behavior...
a little experiment
As an experiment, temporarily decrease effective_cache_size value and rerun the same sql...
SET random_page_cost to 2;
-> Index Scan using users_pkey on control.users us (cost=0.29..1.31 rows=1 width=10) (actual time=0.006..0.006 rows=1 loops=24)
Output: us.user_id, us.group_id, us.description, us.password, us.person_id, us.department, us.regist_time, us.modified_time, us.password_expire_time, us.available_from, us.available_to, us.trace_queue, us.available, us.user_name, us.agency_id, us.location, us.last_login_time
Index Cond: (us.user_id = ht.operator)
Buffers: shared hit=71 read=1
Now, restore to the default value = 4
SET random_page_cost to 4;
-> Seq Scan on control.users us (cost=0.00..571.08 rows=21708 width=10) (actual time=0.010..8.800 rows=21708 loops=1)
Output: us.user_name, us.user_id
Buffers: shared hit=354
index scan -> seq scan
Author And Source
この問題について(q scan or index scan - PostgreSQL random_page_cost), 我々は、より多くの情報をここで見つけました https://qiita.com/tkprof/items/883834739d9c37c3ff65著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .