Re: Specific query taking time to process

Fahiz Mohamed <[email protected]> Mon, 9 Dec 2019 22:39:38 +0000
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <10b65cf1-a079-4aa3-92f0-ca21375da683@Spark>
--5deecd30_5e884adc_142
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Thank you very much for your prompt responses.

I have analysed more regarding this and found the long running query.

I ran =22explain analyse=22 on this query and I got following result. (We=
 have 2 identical DB instances and they consist of same data. Instane 1 t=
ook 20+ second to process and instance 2 took less than a second)

Instance 1: (This is used by regular User - More than 600,000 request a d=
ay) - The result is same even when there is no user in the server.
EXPLAIN ANALYZE
Nested Loop Semi Join (cost=3D998547.53..3319573.36 rows=3D1 width=3D8) (=
actual time=3D10568.217..22945.971 rows=3D22 loops=3D1)
 -> Hash Semi Join (cost=3D998546.96..3319545.95 rows=3D41 width=3D16) (a=
ctual time=3D10568.198..22945.663 rows=3D22 loops=3D1)
    Hash Cond: (node.id =3D prop.node=5Fid)
    -> Bitmap Heap Scan on alf=5Fnode node (cost=3D995009.97..3303978.85 =
rows=3D4565737 width=3D8) (actual time=3D3304.419..20465.551 rows=3D41109=
751 loops=3D1)
       Recheck Cond: ((store=5Fid =3D 6) AND (type=5Fqname=5Fid =3D 240))=

       Rows Removed by Index Recheck: 54239131
       =46ilter: (NOT (hashed SubPlan 1))
       Rows Removed by =46ilter: 2816
       Heap Blocks: exact=3D24301 lossy=3D1875383
       -> Bitmap Index Scan on idx=5Falf=5Fnode=5Fmdq (cost=3D0.00..64614=
4.01 rows=3D20047144 width=3D0) (actual time=3D3232.067..3232.067 rows=3D=
44246360 loops=3D1)
          Index Cond: ((store=5Fid =3D 6) AND (type=5Fqname=5Fid =3D 240)=
)
       SubPlan 1
        -> Bitmap Heap Scan on alf=5Fnode=5Faspects aspect=5F1 (cost=3D25=
03.51..347403.58 rows=3D128379 width=3D8) (actual time=3D25.447..65.392 r=
ows=3D5635 loops=3D1)
           Recheck Cond: (qname=5Fid =3D 251)
           Heap Blocks: exact=3D40765
           -> Bitmap Index Scan on fk=5Falf=5Fnasp=5Fqn (cost=3D0.00..247=
1.41 rows=3D128379 width=3D0) (actual time=3D18.835..18.835 rows=3D239610=
 loops=3D1)
              Index Cond: (qname=5Fid =3D 251)
    -> Hash (cost=3D3526.11..3526.11 rows=3D871 width=3D8) (actual time=3D=
0.045..0.045 rows=3D23 loops=3D1)
       Buckets: 1024 Batches: 1 Memory Usage: 9kB
       -> Index Only Scan using idx=5Falf=5Fnprop=5Fs on alf=5Fnode=5Fpro=
perties prop (cost=3D0.70..3526.11 rows=3D871 width=3D8) (actual time=3D0=
.021..0.042 rows=3D23 loops=3D1)
          Index Cond: ((qname=5Fid =3D '242'::bigint) AND (string=5Fvalue=
 =3D 'E292432'::text))
          Heap =46etches: 23
 -> Index Only Scan using alf=5Fnode=5Faspects=5Fpkey on alf=5Fnode=5Fasp=
ects aspect (cost=3D0.57..2.01 rows=3D15 width=3D8) (actual time=3D0.011.=
.0.011 rows=3D1 loops=3D22)
    Index Cond: ((node=5Fid =3D node.id) AND (qname=5Fid =3D 245))
    Heap =46etches: 22
Planning time: 0.639 ms
Execution time: 22946.036 ms

Instance 2: (Only by testers - 250 request a day)

Nested Loop Semi Join  (cost=3D6471.94..173560841.08 rows=3D2 width=3D8) =
(actual time=3D0.162..0.464 rows=3D17 loops=3D1)
  ->  Nested Loop  (cost=3D6471.37..173560684.36 rows=3D45 width=3D16) (a=
ctual time=3D0.154..0.387 rows=3D17 loops=3D1)
        ->  HashAggregate  (cost=3D3508.15..3516.80 rows=3D865 width=3D8)=
 (actual time=3D0.041..0.047 rows=3D18 loops=3D1)
              Group Key: prop.node=5Fid
              ->  Index Only Scan using idx=5Falf=5Fnprop=5Fs on alf=5Fno=
de=5Fproperties prop  (cost=3D0.70..3505.99 rows=3D866 width=3D8) (actual=
 time=3D0.020..0.035 r
ows=3D18 loops=3D1)
                    Index Cond: ((qname=5Fid =3D '242'::bigint) AND (stri=
ng=5Fvalue =3D 'E292432'::text))
                    Heap =46etches: 18
        ->  Index Scan using alf=5Fnode=5Fpkey on alf=5Fnode node  (cost=3D=
2963.22..200644.11 rows=3D1 width=3D8) (actual time=3D0.019..0.019 rows=3D=
1 loops=3D18)
              Index Cond: (id =3D prop.node=5Fid)
              =46ilter: ((type=5Fqname=5Fid <> 145) AND (store=5Fid =3D 6=
) AND (type=5Fqname=5Fid =3D 240) AND (NOT (SubPlan 1)))
              Rows Removed by =46ilter: 0
              SubPlan 1
                ->  Materialize  (cost=3D2962.65..397912.89 rows=3D158204=
 width=3D8) (actual time=3D0.001..0.009 rows=3D85 loops=3D17)
                      ->  Bitmap Heap Scan on alf=5Fnode=5Faspects aspect=
=5F1  (cost=3D2962.65..396503.87 rows=3D158204 width=3D8) (actual time=3D=
0.021..0.082 rows=3D
85 loops=3D1)
                            Recheck Cond: (qname=5Fid =3D 251)
                            Heap Blocks: exact=3D55
                            ->  Bitmap Index Scan on fk=5Falf=5Fnasp=5Fqn=
  (cost=3D0.00..2923.10 rows=3D158204 width=3D0) (actual time=3D0.015..0.=
015 rows=3D87 loops=3D
1)
                                  Index Cond: (qname=5Fid =3D 251)
  ->  Index Only Scan using alf=5Fnode=5Faspects=5Fpkey on alf=5Fnode=5Fa=
spects aspect  (cost=3D0.57..34.32 rows=3D12 width=3D8) (actual time=3D0.=
004..0.004 rows=3D1 loop
s=3D17)
        Index Cond: ((node=5Fid =3D node.id) AND (qname=5Fid =3D 245))
        Heap =46etches: 17
Planning time: 0.623 ms
Execution time: 0.540 ms

Configurations are same in both servers.

Please advise me on this. Is there any configuration specifically I need =
to look like =E2=80=9Cwork=5Fmem=E2=80=9D, =E2=80=9CShared=5Fbuffers=E2=80=
=9D, =E2=80=9Ccheckpoint=5Fsegment=E2=80=9D, =E2=80=9Ceffective=5Fcache=5F=
size=E2=80=9D, =E2=80=9Cenable=5Fseqscan=E2=80=9D and =E2=80=9Ccheckpoint=
=5Fcompression=5Ftarget=E2=80=9D=3F

Thanks in advance.

=46ahiz

On 9 Dec 2019, 19:03 +0000, Michael Lewis <mlewis=40entrata.com>, wrote:
> > > There is a specific search query I am running to get list of Docume=
nts and their metadata from several table in the DB.
> > > We are running Postgres 9.6.9 on Amazon RDS (db.m5.4xlarge instance=
)
> > >
> > > Our current DB consists of 500GB of data and indexes. Most of the r=
ows in table are consist of=C2=A0454,078,915
> > >
> > > With the fresh DB with the restore of the DATA without any indexes =
Search query performs relatively quick and most of the time its less than=
 a second.
> > >
> > > But after 3 weeks of use of the DB it sudenly started to slowdown o=
nly for this perticular query and it takes 20+ seconds to respond. If I d=
o a restore the DB again then it continues to work fine and the symptom p=
ops out after 3 weeks time.
> >
> >
> > You haven't been quite clear on the situation and your use case, but =
assuming this table has 454 million rows and experiences updates/deletes =
then this sounds like you may be having problems with autovacuum. Have yo=
u customized parameters to ensure it is running more frequently than defa=
ult=3F How are you doing those data restores=3F Perhaps that process is c=
leaning up the accumulated bloat and you can run fine again for a while. =
Check pg=5Fstat=5Fuser=5Ftables for the last (auto)vacuum that ran, assum=
ing you didn't just restore again and are expecting the issue to occur ag=
ain soon.

--5deecd30_5e884adc_142
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<html xmlns=3D=22http://www.w3.org/1999/xhtml=22>
<head>
<title></title>
</head>
<body>
<div name=3D=22messageBodySection=22>
<div dir=3D=22auto=22>Thank you very much for your prompt responses.
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>I have analysed more regarding this and found the l=
ong running query.</div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>I ran =22explain analyse=22 on this query and I got=
 following result. (We have 2 identical DB instances and they consist of =
same data. Instane 1 took 20+ second to process and instance 2 took less =
than a second)</div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>Instance 1: (This is used by regular User - More th=
an 600,000 request a day) - The result is same even when there is no user=
 in the server.</div>
<div dir=3D=22auto=22>
<pre class=3D=22c-mrkdwn=5F=5Fpre=22 data-stringify-type=3D=22pre=22 styl=
e=3D=22box-sizing: inherit; margin-top: 4px; margin-bottom: 4px; padding:=
 8px; --saf-0: rgba(var(--sk=5Fforeground=5Flow,29,28,29),0.13); font-siz=
e: 12px; line-height: 1.50001; font-variant-ligatures: none; white-space:=
 pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; bo=
rder: 1px solid var(--saf-0); border-top-left-radius: 4px; border-top-rig=
ht-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radiu=
s: 4px; background: rgba(var(--sk=5Fforeground=5Fmin,29,28,29),0.04); cou=
nter-reset: list-0 0 list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 =
0 list-7 0 list-8 0 list-9 0; color: rgb(209, 210, 211); orphans: 2; wido=
ws: 2; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, mon=
ospace =21important;=22>EXPLAIN ANALYZE<br style=3D=22box-sizing: inherit=
;=22 />Nested Loop Semi Join (cost=3D998547.53..3319573.36 rows=3D1 width=
=3D8) (actual time=3D10568.217..22945.971 rows=3D22 loops=3D1)<br style=3D=
=22box-sizing: inherit;=22 />  -&gt; Hash Semi Join (cost=3D998546.96..33=
19545.95 rows=3D41 width=3D16) (actual time=3D10568.198..22945.663 rows=3D=
22 loops=3D1)<br style=3D=22box-sizing: inherit;=22 />     Hash Cond: (no=
de.id =3D prop.node=5Fid)<br style=3D=22box-sizing: inherit;=22 />     -&=
gt; Bitmap Heap Scan on alf=5Fnode node (cost=3D995009.97..3303978.85 row=
s=3D4565737 width=3D8) (actual time=3D3304.419..20465.551 rows=3D41109751=
 loops=3D1)<br style=3D=22box-sizing: inherit;=22 />        Recheck Cond:=
 ((store=5Fid =3D 6) AND (type=5Fqname=5Fid =3D 240))<br style=3D=22box-s=
izing: inherit;=22 />        Rows Removed by Index Recheck: 54239131<br s=
tyle=3D=22box-sizing: inherit;=22 />        =46ilter: (NOT (hashed SubPla=
n 1))<br style=3D=22box-sizing: inherit;=22 />        Rows Removed by =46=
ilter: 2816<br style=3D=22box-sizing: inherit;=22 />        Heap Blocks: =
exact=3D24301 lossy=3D1875383<br style=3D=22box-sizing: inherit;=22 />   =
     -&gt; Bitmap Index Scan on idx=5Falf=5Fnode=5Fmdq (cost=3D0.00..6461=
44.01 rows=3D20047144 width=3D0) (actual time=3D3232.067..3232.067 rows=3D=
44246360 loops=3D1)<br style=3D=22box-sizing: inherit;=22 />           In=
dex Cond: ((store=5Fid =3D 6) AND (type=5Fqname=5Fid =3D 240))<br style=3D=
=22box-sizing: inherit;=22 />        SubPlan 1<br style=3D=22box-sizing: =
inherit;=22 />         -&gt; Bitmap Heap Scan on alf=5Fnode=5Faspects asp=
ect=5F1 (cost=3D2503.51..347403.58 rows=3D128379 width=3D8) (actual time=3D=
25.447..65.392 rows=3D5635 loops=3D1)<br style=3D=22box-sizing: inherit;=22=
 />            Recheck Cond: (qname=5Fid =3D 251)<br style=3D=22box-sizin=
g: inherit;=22 />            Heap Blocks: exact=3D40765<br style=3D=22box=
-sizing: inherit;=22 />            -&gt; Bitmap Index Scan on fk=5Falf=5F=
nasp=5Fqn (cost=3D0.00..2471.41 rows=3D128379 width=3D0) (actual time=3D1=
8.835..18.835 rows=3D239610 loops=3D1)<br style=3D=22box-sizing: inherit;=
=22 />               Index Cond: (qname=5Fid =3D 251)<br style=3D=22box-s=
izing: inherit;=22 />     -&gt; Hash (cost=3D3526.11..3526.11 rows=3D871 =
width=3D8) (actual time=3D0.045..0.045 rows=3D23 loops=3D1)<br style=3D=22=
box-sizing: inherit;=22 />        Buckets: 1024 Batches: 1 Memory Usage: =
9kB<br style=3D=22box-sizing: inherit;=22 />        -&gt; Index Only Scan=
 using idx=5Falf=5Fnprop=5Fs on alf=5Fnode=5Fproperties prop (cost=3D0.70=
..3526.11 rows=3D871 width=3D8) (actual time=3D0.021..0.042 rows=3D23 loo=
ps=3D1)<br style=3D=22box-sizing: inherit;=22 />           Index Cond: ((=
qname=5Fid =3D '242'::bigint) AND (string=5Fvalue =3D 'E292432'::text))<b=
r style=3D=22box-sizing: inherit;=22 />           Heap =46etches: 23<br s=
tyle=3D=22box-sizing: inherit;=22 />  -&gt; Index Only Scan using alf=5Fn=
ode=5Faspects=5Fpkey on alf=5Fnode=5Faspects aspect (cost=3D0.57..2.01 ro=
ws=3D15 width=3D8) (actual time=3D0.011..0.011 rows=3D1 loops=3D22)<br st=
yle=3D=22box-sizing: inherit;=22 />     Index Cond: ((node=5Fid =3D node.=
id) AND (qname=5Fid =3D 245))<br style=3D=22box-sizing: inherit;=22 />   =
  Heap =46etches: 22<br style=3D=22box-sizing: inherit;=22 /> Planning ti=
me: 0.639 ms<br style=3D=22box-sizing: inherit;=22 /> Execution time: 229=
46.036 ms</pre></div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>Instance 2: (Only by testers - 250 request a day)</=
div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>
<pre class=3D=22c-mrkdwn=5F=5Fpre=22 data-stringify-type=3D=22pre=22 styl=
e=3D=22box-sizing: inherit; margin-top: 4px; margin-bottom: 4px; padding:=
 8px; --saf-0: rgba(var(--sk=5Fforeground=5Flow,29,28,29),0.13); font-siz=
e: 12px; line-height: 1.50001; font-variant-ligatures: none; white-space:=
 pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; bo=
rder: 1px solid var(--saf-0); border-top-left-radius: 4px; border-top-rig=
ht-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radiu=
s: 4px; background: rgba(var(--sk=5Fforeground=5Fmin,29,28,29),0.04); cou=
nter-reset: list-0 0 list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 =
0 list-7 0 list-8 0 list-9 0; color: rgb(209, 210, 211); orphans: 2; wido=
ws: 2; font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, mon=
ospace =21important;=22>Nested Loop Semi Join  (cost=3D6471.94..173560841=
.08 rows=3D2 width=3D8) (actual time=3D0.162..0.464 rows=3D17 loops=3D1)<=
br style=3D=22box-sizing: inherit;=22 />   -&gt;  Nested Loop  (cost=3D64=
71.37..173560684.36 rows=3D45 width=3D16) (actual time=3D0.154..0.387 row=
s=3D17 loops=3D1)<br style=3D=22box-sizing: inherit;=22 />         -&gt; =
 HashAggregate  (cost=3D3508.15..3516.80 rows=3D865 width=3D8) (actual ti=
me=3D0.041..0.047 rows=3D18 loops=3D1)<br style=3D=22box-sizing: inherit;=
=22 />               Group Key: prop.node=5Fid<br style=3D=22box-sizing: =
inherit;=22 />               -&gt;  Index Only Scan using idx=5Falf=5Fnpr=
op=5Fs on alf=5Fnode=5Fproperties prop  (cost=3D0.70..3505.99 rows=3D866 =
width=3D8) (actual time=3D0.020..0.035 r<br style=3D=22box-sizing: inheri=
t;=22 />ows=3D18 loops=3D1)<br style=3D=22box-sizing: inherit;=22 />     =
                Index Cond: ((qname=5Fid =3D '242'::bigint) AND (string=5F=
value =3D 'E292432'::text))<br style=3D=22box-sizing: inherit;=22 />     =
                Heap =46etches: 18<br style=3D=22box-sizing: inherit;=22 =
/>         -&gt;  Index Scan using alf=5Fnode=5Fpkey on alf=5Fnode node  =
(cost=3D2963.22..200644.11 rows=3D1 width=3D8) (actual time=3D0.019..0.01=
9 rows=3D1 loops=3D18)<br style=3D=22box-sizing: inherit;=22 />          =
     Index Cond: (id =3D prop.node=5Fid)<br style=3D=22box-sizing: inheri=
t;=22 />               =46ilter: ((type=5Fqname=5Fid &lt;&gt; 145) AND (s=
tore=5Fid =3D 6) AND (type=5Fqname=5Fid =3D 240) AND (NOT (SubPlan 1)))<b=
r style=3D=22box-sizing: inherit;=22 />               Rows Removed by =46=
ilter: 0<br style=3D=22box-sizing: inherit;=22 />               SubPlan 1=
<br style=3D=22box-sizing: inherit;=22 />                 -&gt;  Material=
ize  (cost=3D2962.65..397912.89 rows=3D158204 width=3D8) (actual time=3D0=
.001..0.009 rows=3D85 loops=3D17)<br style=3D=22box-sizing: inherit;=22 /=
>                       -&gt;  Bitmap Heap Scan on alf=5Fnode=5Faspects a=
spect=5F1  (cost=3D2962.65..396503.87 rows=3D158204 width=3D8) (actual ti=
me=3D0.021..0.082 rows=3D<br style=3D=22box-sizing: inherit;=22 />85 loop=
s=3D1)<br style=3D=22box-sizing: inherit;=22 />                          =
   Recheck Cond: (qname=5Fid =3D 251)<br style=3D=22box-sizing: inherit;=22=
 />                             Heap Blocks: exact=3D55<br style=3D=22box=
-sizing: inherit;=22 />                             -&gt;  Bitmap Index S=
can on fk=5Falf=5Fnasp=5Fqn  (cost=3D0.00..2923.10 rows=3D158204 width=3D=
0) (actual time=3D0.015..0.015 rows=3D87 loops=3D<br style=3D=22box-sizin=
g: inherit;=22 />1)<br style=3D=22box-sizing: inherit;=22 />             =
                      Index Cond: (qname=5Fid =3D 251)<br style=3D=22box-=
sizing: inherit;=22 />   -&gt;  Index Only Scan using alf=5Fnode=5Faspect=
s=5Fpkey on alf=5Fnode=5Faspects aspect  (cost=3D0.57..34.32 rows=3D12 wi=
dth=3D8) (actual time=3D0.004..0.004 rows=3D1 loop<br style=3D=22box-sizi=
ng: inherit;=22 />s=3D17)<br style=3D=22box-sizing: inherit;=22 />       =
  Index Cond: ((node=5Fid =3D node.id) AND (qname=5Fid =3D 245))<br style=
=3D=22box-sizing: inherit;=22 />         Heap =46etches: 17<br style=3D=22=
box-sizing: inherit;=22 /> Planning time: 0.623 ms<br style=3D=22box-sizi=
ng: inherit;=22 /> Execution time: 0.540 ms</pre></div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>Configurations are same in both servers.</div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>Please advise me on this. Is there any configuratio=
n specifically I need to look like =E2=80=9Cwork=5Fmem=E2=80=9D, =E2=80=9C=
Shared=5Fbuffers=E2=80=9D, =E2=80=9Ccheckpoint=5Fsegment=E2=80=9D, =E2=80=
=9Ceffective=5Fcache=5Fsize=E2=80=9D, =E2=80=9Cenable=5Fseqscan=E2=80=9D =
and =E2=80=9Ccheckpoint=5Fcompression=5Ftarget=E2=80=9D=3F&=23160;</div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>Thanks in advance.</div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>=46ahiz</div>
<div dir=3D=22auto=22><br /></div>
</div>
</div>
<div name=3D=22messageReplySection=22>On 9 Dec 2019, 19:03 +0000, Michael=
 Lewis &lt;mlewis=40entrata.com&gt;, wrote:<br />
<blockquote type=3D=22cite=22 class=3D=22spark=5Fquote=22 style=3D=22marg=
in: 5px 5px; padding-left: 10px; border-left: thin solid =231abc9c;=22>
<div dir=3D=22ltr=22>
<div class=3D=22gmail=5Fquote=22>
<blockquote class=3D=22gmail=5Fquote spark=5Fquote=22 style=3D=22margin: =
5px 5px; padding-left: 10px; border-left: thin solid =23e67e22;=22>
<div>
<div name=3D=22messageBodySection=22>
<div dir=3D=22auto=22>
<div dir=3D=22auto=22>There is a specific search query I am running to ge=
t list of Documents and their metadata from several table in the DB.<br /=
></div>
<div dir=3D=22auto=22>We are running Postgres 9.6.9 on Amazon RDS (<span =
style=3D=22color:rgb(209,210,211);font-family:Monaco,Menlo,Consolas,&quot=
;Courier New&quot;,monospace;font-size:12px;white-space:pre-wrap=22>db.m5=
.4xlarge instance)</span></div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>Our current DB consists of 500GB of data and indexe=
s. Most of the rows in table are consist of&=23160;<span style=3D=22color=
:rgb(209,210,211);font-family:Slack-Lato,appleLogo,sans-serif;font-size:1=
5px;white-space:pre-wrap;background-color:rgb(26,29,33)=22>454,078,915</s=
pan></div>
</div>
</div>
<div name=3D=22messageSignatureSection=22><br />
<div dir=3D=22auto=22>With the fresh DB with the restore of the DATA with=
out any indexes Search query performs relatively quick and most of the ti=
me its less than a second.&=23160;</div>
<div dir=3D=22auto=22><br /></div>
<div dir=3D=22auto=22>But after 3 weeks of use of the DB it sudenly start=
ed to slowdown only for this perticular query and it takes 20+ seconds to=
 respond. If I do a restore the DB again then it continues to work fine a=
nd the symptom pops out after 3 weeks time.&=23160;</div>
</div>
</div>
</blockquote>
<div><br /></div>
<div><br /></div>
<div>You haven't been quite clear on the situation and your use case, but=
 assuming this table has 454 million rows and experiences updates/deletes=
 then this sounds like you may be having problems with autovacuum. Have y=
ou customized parameters to ensure it is running more frequently than def=
ault=3F How are you doing those data restores=3F Perhaps that process is =
cleaning up the accumulated bloat and you can run fine again for a while.=
 Check pg=5Fstat=5Fuser=5Ftables for the last (auto)vacuum that ran, assu=
ming you didn't just restore again and are expecting the issue to occur a=
gain soon.</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>

--5deecd30_5e884adc_142--