Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j043u-0006KY-FJ for pgsql-performance@arkaria.postgresql.org; Fri, 07 Feb 2020 13:52:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j043r-0003PH-Ke for pgsql-performance@arkaria.postgresql.org; Fri, 07 Feb 2020 13:52:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j043r-0003PA-80 for pgsql-performance@lists.postgresql.org; Fri, 07 Feb 2020 13:52:47 +0000 Received: from mout.perfora.net ([74.208.4.194]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j043k-0002dY-BF for pgsql-performance@lists.postgresql.org; Fri, 07 Feb 2020 13:52:46 +0000 Received: from [192.168.1.143] ([98.169.208.7]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LykDJ-1jctCa0HqR-0164Rz; Fri, 07 Feb 2020 14:52:31 +0100 Subject: Re: TOAST table performance problem To: Andreas Joseph Krogh Cc: pgsql-performance@lists.postgresql.org References: From: MichaelDBA Message-ID: Date: Fri, 7 Feb 2020 08:52:26 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.11 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------5DB7248D68A78D0021734D44" Content-Language: en-US X-Provags-ID: V03:K1:RFrxx6YlUnfc6P6NOfaiuv5J33xA7keIbPCLNv6lRL5Tizp+AMU efk4q3ZZxvmW5xPm3+YVKMOsQmSgQA4nnjnCFysAYyLunkS/KPnS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Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------5DB7248D68A78D0021734D44 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Yes, I would concur that this planning time and execution time do not take into account the network time sending the data back to the client, especially since your are sending back the entire contents of the table. Regards, Michael Vitale Andreas Joseph Krogh wrote on 2/7/2020 8:41 AM: > På fredag 07. februar 2020 kl. 14:23:35, skrev Asya Nevra Buyuksoy > >: > > Sorry for the misunderstanding. > I have a table like; > CREATE TABLE zamazin > ( >   paramuser_id text, >   paramperson_id integer, >   paramdata json, >   paramisdeleted boolean, >   paramactiontime timestamp without time zone > ) > paramdata row size is 110KB and over. > When I execute this query like; > *select * from zamazin* > it takes *600 seconds*. > But when analyze the query ; > *"Seq Scan on public.zamazin  (cost=0.00..21.77 rows=1077 > width=49) (actual time=0.008..0.151 rows=1077 loops=1)" > "  Output: paramuser_id, paramperson_id, paramdata, > paramisdeleted, paramactiontime" > "  Buffers: shared hit=11" > "Planning time: 0.032 ms" > "Execution time: 0.236 ms"* >  Why the query takes a long time, I do not understand. I > assume that this relates to the TOAST structure. > > My guess is the time is spent in the /client/ retrieving the data, not > in the DB itself. Are you on a slow network? > -- > *Andreas Joseph Krogh* > CTO / Partner - Visena AS > Mobile: +47 909 56 963 > andreas@visena.com > www.visena.com > --------------5DB7248D68A78D0021734D44 Content-Type: multipart/related; boundary="------------CF9563D336EEFFD444E6EFDA" --------------CF9563D336EEFFD444E6EFDA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Yes, I would concur that this planning time and execution time do not take into account the network time sending the data back to the client, especially since your are sending back the entire contents of the table.

Regards,
Michael Vitale

Andreas Joseph Krogh wrote on 2/7/2020 8:41 AM:
På fredag 07. februar 2020 kl. 14:23:35, skrev Asya Nevra Buyuksoy <ayisan1096@gmail.com>:
Sorry for the misunderstanding.
I have a table like;
CREATE TABLE zamazin
(
  paramuser_id text,
  paramperson_id integer,
  paramdata json,
  paramisdeleted boolean,
  paramactiontime timestamp without time zone
)
paramdata row size is 110KB and over.
 
When I execute this query like;
select * from zamazin
it takes 600 seconds.
But when analyze the query ;
"Seq Scan on public.zamazin  (cost=0.00..21.77 rows=1077 width=49) (actual time=0.008..0.151 rows=1077 loops=1)"
"  Output: paramuser_id, paramperson_id, paramdata, paramisdeleted, paramactiontime"
"  Buffers: shared hit=11"
"Planning time: 0.032 ms"
"Execution time: 0.236 ms"
 Why the query takes a long time, I do not understand. I assume that this relates to the TOAST structure.
 
My guess is the time is spent in the client retrieving the data, not in the DB itself. Are you on a slow network?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 

--------------CF9563D336EEFFD444E6EFDA Content-Type: image/png; name="image.png" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="image.png" iVBORw0KGgoAAAANSUhEUgAAAIUAAAAYCAYAAADUIj6hAAAE/0lEQVRoge1a0ZHiMAx1CVSw 0U9AsmcuLoESKIESKCEdUEJKoISUkM+b2buQElIC97GWkYVDYA72Z/Nm+MDWKo71/CR5MWbB gmfwCd6fi6rri+rUgV/N2XfgV31Rnc5F1X2C99+xxgXfiA786lxU4xn85Qz+0oM/PGDfRfui On3XWhd8E/qiOnGAz+Avv8HDM/Z/we++Y52IeHddC16EHvwhBrioxk/wnlPJuag6TZD+o2oU IfbBT30uqvYdqQQRwRGNjuhiEetX+18g8Anea0LcpAbwNdv34OssISRRiqp99ToRceuILo7o 4hBf7n9BQAj+IAlhzHRq+At+Lwl0JcSvo7R/R30BACtLdHKILSJuX+1/QUA83ZIQUgm+As+E 2GlFCeN7SYhzUbUd+NUneN+Dr1+ZShBxGz4gx11ZejG3vff3RHSg9XrnynJ2XcIvTNkAwIqf +4jPnH8AmOz0EBHY/z07td7tM3MRMZhFNYgAZwMf6otxjhD9R9Xk7CdfAnHPKcEiNnreIjY8 L9MH1xSuLL1FHGJauc4PtF7v1HNGbecQWw6k9E9EB+3XEp1kUABgJdcnfVq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6wFPwT9 R9XIf5Uv+OHglnT5Ye6CBT8I/wDYlyYSraMJeQAAAABJRU5ErkJggg== --------------CF9563D336EEFFD444E6EFDA-- --------------5DB7248D68A78D0021734D44--