pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15387: explain analyze timing on bug?
2+ messages / 2 participants
[nested] [flat]

* BUG #15387: explain analyze timing on bug?
@ 2018-09-18 02:45  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2018-09-18 02:45 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: digoal@126.com

The following bug has been logged on the website:

Bug reference:      15387
Logged by:          Zhou Digoal
Email address:      digoal@126.com
PostgreSQL version: 11beta3
Operating system:   CentOS 7.x x64
Description:        

when turn on timing for explain analyze:

```
postgres=# explain (analyze on,verbose on,timing on,costs on,buffers
on,summary on) select count(*) from item1;
                                                       QUERY PLAN           
                                           
------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=254.75..254.75 rows=1 width=8) (actual time=26.938..26.938
rows=1 loops=1)
   Output: count(*)
   Buffers: shared hit=1334
   ->  Seq Scan on public.item1  (cost=0.00..38.00 rows=100000 width=0)
(actual time=0.011..15.674 rows=100000 loops=1)
         Output: i_id, i_im_id, i_name, i_price, i_data
         Buffers: shared hit=1334
 Planning Time: 0.065 ms
 Execution Time: 26.967 ms
(8 rows)

Time: 27.291 ms
```

when turn off timing:

```
postgres=# explain (analyze on,verbose on,timing off,costs on,buffers
on,summary on) select count(*) from item1;
                                             QUERY PLAN                     
                        
-----------------------------------------------------------------------------------------------------
 Aggregate  (cost=254.75..254.75 rows=1 width=8) (actual rows=1 loops=1)
   Output: count(*)
   Buffers: shared hit=1334
   ->  Seq Scan on public.item1  (cost=0.00..38.00 rows=100000 width=0)
(actual rows=100000 loops=1)
         Output: i_id, i_im_id, i_name, i_price, i_data
         Buffers: shared hit=1334
 Planning Time: 0.062 ms
 Execution Time: 11.050 ms
(8 rows)

Time: 11.394 ms
```

why turn timing on increment about 26ms ?



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #15387: explain analyze timing on bug?
@ 2018-09-18 03:27  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-09-18 03:27 UTC (permalink / raw)
  To: digoal@126.com; +Cc: pgsql-bugs@lists.postgresql.org

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> why turn timing on increment about 26ms ?

That's the cost of reading the system clock 200000 times (once per
entry and exit to the SeqScan node).  So apparently that takes about
130ns on your hardware, which is not great, but not awful either.

See

https://www.postgresql.org/message-id/flat/31856.1400021891%40sss.pgh.pa.us

for some more context.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-09-18 03:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18 02:45 BUG #15387: explain analyze timing on bug? PG Bug reporting form <noreply@postgresql.org>
2018-09-18 03:27 ` Tom Lane <tgl@sss.pgh.pa.us>

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