pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: EffiSYS / Martin Querleu <martin.querleu@effisys.fr>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: Strange query planner behavior
Date: Sat, 30 Nov 2019 15:53:52 +0100
Message-ID: <20191130145352.hhr4n45cdsyjkzr5@development> (raw)
In-Reply-To: <b4834a66-c023-01c2-3b11-fb4af0d1e262@effisys.fr>
References: <798855a5-4abe-b1d0-68ab-f21966d2c3a1@effisys.fr>
	<CAFj8pRBYY9D0UW44=AKeBG8BJXq4NHA4WqAofLDQWAUFCfLQXA@mail.gmail.com>
	<CAFj8pRB4CLf-m3KMjAiQ3QUpLCX38wiJTKzzuyyAE6MCOeff4w@mail.gmail.com>
	<b4834a66-c023-01c2-3b11-fb4af0d1e262@effisys.fr>

On Sat, Nov 30, 2019 at 11:29:53AM +0100, EffiSYS / Martin Querleu wrote:
>Hi Pavel
>
>Thanks for the fast reply
>Our databases are VACUUMed everyday. I did it again but no difference
>
>Here are the query plans:
>
>EFT_MBON=# explain analyse select * from livraison where id_master = 10;
> QUERY PLAN
>--------------------------------------------------------------------------------------------------------------------------------------------
> Index Scan using pour_recherche_sous_livraison on livraison 
> (cost=0.03..15.04 rows=1 width=697) (actual time=0.017..0.017 rows=0 
>loops=1)
>   Index Cond: (id_master = 10)
> Planning Time: 0.124 ms
> Execution Time: 0.036 ms
>(4 lignes)
>
>EFT_MBON=# explain analyse select * from livraison where id_master = 
>(select 10);
>                                                      QUERY PLAN
>-----------------------------------------------------------------------------------------------------------------------
> Seq Scan on livraison  (cost=0.01..2888156.69 rows=1917632 width=697) 
>(actual time=1334.615..1334.615 rows=0 loops=1)
>   Filter: (id_master = $0)
>   Rows Removed by Filter: 1918196
>   InitPlan 1 (returns $0)
>     ->  Result  (cost=0.00..0.01 rows=1 width=4) (actual 
>time=0.000..0.001 rows=1 loops=1)
> Planning Time: 0.138 ms
> Execution Time: 1334.642 ms
>(7 lignes)
>
>Regarding the cost calculator the configuration is as follows:
>
>random_page_cost and seq_page_cost are identical since the data is 
>100% in RAM (both at 15.0, 3 times default)

Ummm, what? Does this mean you have 

random_page_cost = 15
seq_page_cost = 15

Neither of that is 3 times the default value, though, so maybe I just
don't understand correctly.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 





view thread (10+ messages)  latest in thread

Message-ID: <20191130145352.hhr4n45cdsyjkzr5@development>
Permalink:  ../20191130145352.hhr4n45cdsyjkzr5@development/
Also on:    postgresql.org/message-id/20191130145352.hhr4n45cdsyjkzr5@development

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, martin.querleu@effisys.fr, pavel.stehule@gmail.com
  Subject: Re: Strange query planner behavior
  In-Reply-To: <20191130145352.hhr4n45cdsyjkzr5@development>
  References: <798855a5-4abe-b1d0-68ab-f21966d2c3a1@effisys.fr> <CAFj8pRBYY9D0UW44=AKeBG8BJXq4NHA4WqAofLDQWAUFCfLQXA@mail.gmail.com> <CAFj8pRB4CLf-m3KMjAiQ3QUpLCX38wiJTKzzuyyAE6MCOeff4w@mail.gmail.com> <b4834a66-c023-01c2-3b11-fb4af0d1e262@effisys.fr> <20191130145352.hhr4n45cdsyjkzr5@development>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox