Re: [PATCHES] Avg performance for int8/numeric - Mailing list pgsql-hackers

From Mark Kirkwood
Subject Re: [PATCHES] Avg performance for int8/numeric
Date
Msg-id 4567A787.6020808@paradise.net.nz
Whole thread Raw
In response to Re: [PATCHES] Avg performance for int8/numeric  (Mark Kirkwood <markir@paradise.net.nz>)
Responses Re: [PATCHES] Avg performance for int8/numeric  ("Luke Lonergan" <llonergan@greenplum.com>)
List pgsql-hackers
Mark Kirkwood wrote:

>>
>
> I've profiled the 2nd patch using the setup indicated below. The first
> 64 lines of the flat graph are attached.

By way of comparison, here is the first 63 lines for:

select sum(val2) from avgtest


Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 10.65      0.80     0.80 50002910     0.00     0.00  AllocSetAlloc
  8.66      1.45     0.65 10000000     0.00     0.00  slot_deform_tuple
  7.86      2.04     0.59 40001617     0.00     0.00  AllocSetFree
  7.46      2.60     0.56  9999999     0.00     0.00  add_abs
  6.13      3.06     0.46  9999999     0.00     0.00  numeric_add
  4.93      3.43     0.37  9999999     0.00     0.00  make_result
  4.53      3.77     0.34 10000000     0.00     0.00  advance_transition_function
  3.46      4.03     0.26 29999998     0.00     0.00  free_var
  3.46      4.29     0.26 10000003     0.00     0.00  AllocSetReset
  3.46      4.55     0.26 10000000     0.00     0.00  advance_aggregates
  3.33      4.80     0.25 50002592     0.00     0.00  MemoryContextAlloc
  3.20      5.04     0.24 10000001     0.00     0.00  heapgettup_pagemode
  3.06      5.27     0.23 19999999     0.00     0.00  set_var_from_num
  2.26      5.44     0.17 10000001     0.00     0.00  slot_getattr
  2.13      5.60     0.16 40001616     0.00     0.00  pfree
  2.13      5.76     0.16 10000003     0.00     0.00  ExecProcNode
  2.13      5.92     0.16 10000001     0.00     0.00  ExecScan
  1.73      6.05     0.13 10000103     0.00     0.00  heap_getnext
  1.60      6.17     0.12 10000001     0.00     0.00  SeqNext
  1.60      6.29     0.12 10000000     0.00     0.00  XidInSnapshot
  1.60      6.41     0.12  9999999     0.00     0.00  add_var
  1.46      6.52     0.11 19999999     0.00     0.00  alloc_var
  1.46      6.63     0.11 10000001     0.00     0.00  datumGetSize
  1.33      6.73     0.10 10000001     0.00     0.00  datumCopy
  1.20      6.82     0.09    87860     0.00     0.00  heapgetpage
  1.20      6.91     0.09        2     0.04     3.03  ExecAgg
  0.93      6.98     0.07 10000000     0.00     0.00  ExecEvalVar
  0.93      7.05     0.07 10000000     0.00     0.00  HeapTupleSatisfiesSnapshot
  0.80      7.11     0.06 20000000     0.00     0.00  pg_detoast_datum
  0.80      7.17     0.06   511486     0.00     0.00  LWLockRelease
  0.80      7.23     0.06   511485     0.00     0.00  LWLockAcquire
  0.67      7.28     0.05 10000001     0.00     0.00  ExecStoreTuple
  0.40      7.31     0.03 10000009     0.00     0.00  TransactionIdPrecedes
  0.40      7.34     0.03 10000001     0.00     0.00  MemoryContextReset
  0.40      7.37     0.03    87761     0.00     0.00  StrategyGetBuffer
  0.27      7.39     0.02 10000001     0.00     0.00  ExecSeqScan
  0.27      7.41     0.02  9999999     0.00     0.00  strip_var
  0.27      7.43     0.02   254355     0.00     0.00  hash_search_with_hash_value
  0.13      7.44     0.01   176862     0.00     0.00  LockBuffer
  0.13      7.45     0.01   175902     0.00     0.00  ResourceOwnerForgetBuffer
  0.13      7.46     0.01   175901     0.00     0.00  UnpinBuffer
  0.13      7.47     0.01   164908     0.00     0.00  hash_any
  0.13      7.48     0.01    88213     0.00     0.00  BufTableLookup
  0.13      7.49     0.01    88015     0.00     0.00  ReleaseBuffer
  0.13      7.50     0.01    87761     0.00     0.00  TerminateBufferIO
  0.13      7.51     0.01                             __divdi3
  0.00      7.51     0.00   175903     0.00     0.00  ResourceOwnerEnlargeBuffers
  0.00      7.51     0.00   175902     0.00     0.00  ResourceOwnerRememberBuffer
  0.00      7.51     0.00   164857     0.00     0.00  tag_hash
  0.00      7.51     0.00   163576     0.00     0.00  get_hash_value
  0.00      7.51     0.00   163174     0.00     0.00  BufTableHashCode
  0.00      7.51     0.00    88214     0.00     0.00  ReleaseAndReadBuffer
  0.00      7.51     0.00    88213     0.00     0.00  ReadBuffer
  0.00      7.51     0.00    87802     0.00     0.00  FileSeek
  0.00      7.51     0.00    87802     0.00     0.00  mdopen
  0.00      7.51     0.00    87761     0.00     0.00  BufTableInsert
  0.00      7.51     0.00    87761     0.00     0.00  FileAccess
  0.00      7.51     0.00    87761     0.00     0.00  FileRead

pgsql-hackers by date:

Previous
From: "Luke Lonergan"
Date:
Subject: Re: [PATCHES] Avg performance for int8/numeric
Next
From: "Luke Lonergan"
Date:
Subject: Re: [PATCHES] Avg performance for int8/numeric