Re: Why index used/not used - Mailing list pgsql-general

From Anton Maksimenkov
Subject Re: Why index used/not used
Date
Msg-id 40FE275C.7060508@hlebprom.ru
Whole thread Raw
In response to Re: Why index used/not used  ("Scott Marlowe" <smarlowe@qwest.net>)
List pgsql-general
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

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Why index used/not used
Next
From: Peter Eisentraut
Date:
Subject: Re: Aligned Output!!