Scott Marlowe wrote:
> There are several settings that tune the planner to tell it when to
> switch from an index scan to a seq scan. random_page_cost is the most
> commonly adusted one. Try dropping it from the default of 4 to
> something around 1.4 to 2.0 or so.
...
> and run the query again. Test several of your queries and find out
> where the turning point is, and then adjust the random_page_cost to
> cause it to switch at about the right time.
Thank's for explain. With "random_page_cost = 2.0" situation is much
better. I will follow you tips.
EXPLAIN ANALYZE SELECT * FROM traf_raw WHERE sip_id='19' LIMIT 10 OFFSET
100000;
...
Limit (cost=5042.22..5042.56 rows=1 width=56) (actual
time=110.32..110.32 rows=0 loops=1)
-> Index Scan using traf_raw_sip on traf_raw (cost=0.00..5042.56
rows=11020 width=56) (actual time=0.30..95.95 rows=10977 loops=1)
Index Cond: (sip_id = 19)
Total runtime: 110.52 msec
--
engineer