pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Binguo Bao <djydewang@gmail.com>
Cc: Paul Ramsey <pramsey@cleverelephant.ca>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Optimize partial TOAST decompression
Date: Thu, 4 Jul 2019 20:02:41 +0200
Message-ID: <20190704180241.le62zaq5oigwgg6d@development> (raw)
In-Reply-To: <20190704174654.vnvkh7rusv25o6f5@development>
References: <CAL-OGkthU9Gs7TZchf5OWaL-Gsi=hXqufTxKv9qpNG73d5na_g@mail.gmail.com>
	<7B7E4A05-F404-4083-B7F2-267869EE2910@yandex-team.ru>
	<CAL-OGktyTE=Svgv8YTXou4UxjK-zFLtxU6Wy3RndgCesGexwkA@mail.gmail.com>
	<DFBA504A-0E2E-4E9C-8C69-A3C308982A2A@yandex-team.ru>
	<CAL-OGkuBn13N1=jBkiWs4oks_3SxVioiec9Sm9zPDKJFU4szyg@mail.gmail.com>
	<CACowWR1U3guqBzqPL1rHWxYBpU-yUQzr+s07MPT9qBg8LGb+uA@mail.gmail.com>
	<CAL-OGkux7+Bm_J=t5VpH7fJGGSm+PxWJtgs1+WU2g6cmLru==A@mail.gmail.com>
	<BFA726EE-9C16-475D-A739-16DFC34931C1@yandex-team.ru>
	<20190704174654.vnvkh7rusv25o6f5@development>

Of course, I forgot to attach the files, so here they are.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 
(gdb) bt
#0  toast_decompress_datum (attr=0x12572e0) at tuptoaster.c:2291
#1  toast_decompress_datum (attr=0x12572e0) at tuptoaster.c:2277
#2  0x00000000004c3b08 in heap_tuple_untoast_attr_slice (attr=<optimized out>, sliceoffset=0, slicelength=-1) at tuptoaster.c:315
#3  0x000000000085c1e5 in pg_detoast_datum_slice (datum=<optimized out>, first=<optimized out>, count=<optimized out>) at fmgr.c:1767
#4  0x0000000000833b7a in text_substring (str=133761519127512, start=0, length=<optimized out>, length_not_specified=<optimized out>) at varlena.c:956
#5  0x0000000000600a5b in ExecInterpExpr (state=0x12549c8, econtext=0x1253728, isnull=<optimized out>) at execExprInterp.c:649
#6  0x000000000061511f in ExecEvalExprSwitchContext (isNull=0x7ffc45db755f, econtext=<optimized out>, state=<optimized out>) at ../../../src/include/executor/executor.h:307
#7  advance_aggregates (aggstate=0x1253500, aggstate=0x1253500) at nodeAgg.c:679
#8  agg_retrieve_direct (aggstate=0x1253500) at nodeAgg.c:1847
#9  ExecAgg (pstate=0x1253500) at nodeAgg.c:1572
#10 0x000000000060371b in ExecProcNode (node=0x1253500) at ../../../src/include/executor/executor.h:239
#11 ExecutePlan (execute_once=<optimized out>, dest=0x12595b8, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_SELECT, use_parallel_mode=<optimized out>, planstate=0x1253500, estate=0x12532c0) at execMain.c:1648
#12 standard_ExecutorRun (queryDesc=0x11be580, direction=<optimized out>, count=0, execute_once=<optimized out>) at execMain.c:365
#13 0x0000000000748b2b in PortalRunSelect (portal=portal@entry=0x12043a0, forward=forward@entry=true, count=0, count@entry=9223372036854775807, dest=dest@entry=0x12595b8) at pquery.c:929
#14 0x0000000000749f00 in PortalRun (portal=portal@entry=0x12043a0, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x12595b8, altdest=altdest@entry=0x12595b8, completionTag=0x7ffc45db77e0 "") at pquery.c:770
#15 0x000000000074611f in exec_simple_query (query_string=0x119c820 "select sum(length(substr(a,0))) from t;") at postgres.c:1215
#16 0x000000000074783e in PostgresMain (argc=<optimized out>, argv=argv@entry=0x11c84d0, dbname=<optimized out>, username=<optimized out>) at postgres.c:4249
#17 0x00000000006d75d9 in BackendRun (port=0x11c09e0, port=0x11c09e0) at postmaster.c:4431
#18 BackendStartup (port=0x11c09e0) at postmaster.c:4122
#19 ServerLoop () at postmaster.c:1704
#20 0x00000000006d840c in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x11963e0) at postmaster.c:1377

Attachments:

  [application/gzip] t.data.gz (1010B, ../20190704180241.le62zaq5oigwgg6d@development/2-t.data.gz)
  download

  [text/plain] bt.txt (2.5K, ../20190704180241.le62zaq5oigwgg6d@development/3-bt.txt)
  download | inline:
(gdb) bt
#0  toast_decompress_datum (attr=0x12572e0) at tuptoaster.c:2291
#1  toast_decompress_datum (attr=0x12572e0) at tuptoaster.c:2277
#2  0x00000000004c3b08 in heap_tuple_untoast_attr_slice (attr=<optimized out>, sliceoffset=0, slicelength=-1) at tuptoaster.c:315
#3  0x000000000085c1e5 in pg_detoast_datum_slice (datum=<optimized out>, first=<optimized out>, count=<optimized out>) at fmgr.c:1767
#4  0x0000000000833b7a in text_substring (str=133761519127512, start=0, length=<optimized out>, length_not_specified=<optimized out>) at varlena.c:956
#5  0x0000000000600a5b in ExecInterpExpr (state=0x12549c8, econtext=0x1253728, isnull=<optimized out>) at execExprInterp.c:649
#6  0x000000000061511f in ExecEvalExprSwitchContext (isNull=0x7ffc45db755f, econtext=<optimized out>, state=<optimized out>) at ../../../src/include/executor/executor.h:307
#7  advance_aggregates (aggstate=0x1253500, aggstate=0x1253500) at nodeAgg.c:679
#8  agg_retrieve_direct (aggstate=0x1253500) at nodeAgg.c:1847
#9  ExecAgg (pstate=0x1253500) at nodeAgg.c:1572
#10 0x000000000060371b in ExecProcNode (node=0x1253500) at ../../../src/include/executor/executor.h:239
#11 ExecutePlan (execute_once=<optimized out>, dest=0x12595b8, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_SELECT, use_parallel_mode=<optimized out>, planstate=0x1253500, estate=0x12532c0) at execMain.c:1648
#12 standard_ExecutorRun (queryDesc=0x11be580, direction=<optimized out>, count=0, execute_once=<optimized out>) at execMain.c:365
#13 0x0000000000748b2b in PortalRunSelect (portal=portal@entry=0x12043a0, forward=forward@entry=true, count=0, count@entry=9223372036854775807, dest=dest@entry=0x12595b8) at pquery.c:929
#14 0x0000000000749f00 in PortalRun (portal=portal@entry=0x12043a0, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, run_once=run_once@entry=true, dest=dest@entry=0x12595b8, altdest=altdest@entry=0x12595b8, completionTag=0x7ffc45db77e0 "") at pquery.c:770
#15 0x000000000074611f in exec_simple_query (query_string=0x119c820 "select sum(length(substr(a,0))) from t;") at postgres.c:1215
#16 0x000000000074783e in PostgresMain (argc=<optimized out>, argv=argv@entry=0x11c84d0, dbname=<optimized out>, username=<optimized out>) at postgres.c:4249
#17 0x00000000006d75d9 in BackendRun (port=0x11c09e0, port=0x11c09e0) at postmaster.c:4431
#18 BackendStartup (port=0x11c09e0) at postmaster.c:4122
#19 ServerLoop () at postmaster.c:1704
#20 0x00000000006d840c in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x11963e0) at postmaster.c:1377

view thread (32+ messages)  latest in thread

Message-ID: <20190704180241.le62zaq5oigwgg6d@development>
Permalink:  ../20190704180241.le62zaq5oigwgg6d@development/
Also on:    postgresql.org/message-id/20190704180241.le62zaq5oigwgg6d@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, x4mmm@yandex-team.ru, djydewang@gmail.com, pramsey@cleverelephant.ca
  Subject: Re: Optimize partial TOAST decompression
  In-Reply-To: <20190704180241.le62zaq5oigwgg6d@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