pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: jasc@gmx.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14948: cost overflow
Date: Tue, 5 Dec 2017 09:39:29 -0300
Message-ID: <20171205123929.pwc6jqvptrdslflr@alvherre.pgsql> (raw)
In-Reply-To: <20171205105924.27108.93509@wrigleys.postgresql.org>

Hi Jan,

it seems pretty likely that these are indeed overflows.  However,
because of the whitespace mangling these plans are pretty much
impossible to read.  Would you mind pasting these again, as text/plain
attachment instead?

Does the query actually take 6ms in the system with the funny explain,
and 5s on the other?

Thanks

jasc@gmx.net wrote:

> Full EXPLAIN (ANALYSE BUFFERS) on the funny looking system:
> 
> GroupAggregate 
> (cost=-25142102027752040829944596389028691968.00..-25142102027752040829944596389028691968.00
> rows=1600000000 width=254) (actual time=1.640..1.640 rows=0 loops=1)
>   Group Key: "*SELECT* 1".sendid_fk, "*SELECT* 1".campaign_fk,
> ('-1'::smallint), (('-1'::smallint)::integer)
>   Buffers: shared hit=11
>   ->  Sort 
> (cost=-25142102027752040829944596389028691968.00..-25142102027752040829944596389028691968.00
> rows=16812456500 width=120) (actual time=1.638..1.638 rows=0 loops=1)
>         Sort Key: "*SELECT* 1".sendid_fk, "*SELECT* 1".campaign_fk,
> ('-1'::smallint), (('-1'::smallint)::integer)
>         Sort Method: quicksort  Memory: 25kB
>         Buffers: shared hit=11
>         ->  Append 
> (cost=329985.38..-25142102027752040829944596389028691968.00 rows=16812456500
> width=120) (actual time=1.621..1.621 rows=0 loops=1)
>               Buffers: shared hit=11
[...]
> Planning time: 7.154 ms
> Execution time: 6.358 ms



> ##############
> # On a different system it looks like this (much more sane):
> ##############
> 
> GroupAggregate  (cost=384347.08..414413.11 rows=37349 width=254) (actual
> time=5343.214..5417.604 rows=1194 loops=1)
>   Group Key: "*SELECT* 1".sendid_fk, "*SELECT* 1".campaign_fk,
> ('-1'::smallint), (('-1'::smallint)::integer)
>   Buffers: shared hit=421793 read=26153, temp read=1561 written=1717
>   ->  Sort  (cost=384347.08..385280.81 rows=373491 width=120) (actual
> time=5343.180..5351.390 rows=55816 loops=1)
>         Sort Key: "*SELECT* 1".sendid_fk, "*SELECT* 1".campaign_fk,
> ('-1'::smallint), (('-1'::smallint)::integer)
>         Sort Method: external merge  Disk: 2880kB
>         Buffers: shared hit=421793 read=26153, temp read=1561 written=1717
>         ->  Append  (cost=140964.58..319780.25 rows=373491 width=120)
> (actual time=2319.179..5287.481 rows=55816 loops=1)
>               Buffers: shared hit=421787 read=26153, temp read=1201
> written=1356


> Planning time: 635.005 ms
> Execution time: 5423.894 ms


-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (11+ messages)  latest in thread

Message-ID: <20171205123929.pwc6jqvptrdslflr@alvherre.pgsql>
Permalink:  ../20171205123929.pwc6jqvptrdslflr@alvherre.pgsql/
Also on:    postgresql.org/message-id/20171205123929.pwc6jqvptrdslflr@alvherre.pgsql

 · 

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: alvherre@2ndquadrant.com, jasc@gmx.net
  Subject: Re: BUG #14948: cost overflow
  In-Reply-To: <20171205123929.pwc6jqvptrdslflr@alvherre.pgsql>
  References: <20171205105924.27108.93509@wrigleys.postgresql.org> <20171205123929.pwc6jqvptrdslflr@alvherre.pgsql>

* 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