Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUNf6-002dw1-UI for pgsql-general@arkaria.postgresql.org; Thu, 18 Jul 2024 09:42:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sUNf4-00DKpU-SA for pgsql-general@arkaria.postgresql.org; Thu, 18 Jul 2024 09:42:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUNf4-00DKpM-HX for pgsql-general@lists.postgresql.org; Thu, 18 Jul 2024 09:42:54 +0000 Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sUNf1-000ARf-UP for pgsql-general@lists.postgresql.org; Thu, 18 Jul 2024 09:42:53 +0000 Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-48fde3a2b17so171552137.0 for ; Thu, 18 Jul 2024 02:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721295771; x=1721900571; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pEYeKFQdTCmcOZCo3uUCM5ivfJOZuWaOvAF6V6Er+ic=; b=ZpKFCLUunnL0AgS+Bxp8PMYGDohsl7q4g5T7701Q0bhlx5CsWgo/lFGOjU0JTtrrH9 PN4+Y20r0NrYgYbxiSg8V5GZ1m8bMsopNIu6THyS0d5FhQ9K+x9++WepVOSJQOVtDF6E 4Aqgm17BBUzTUrlKqxHHKTOae4jtUy9muP68BIAtBagaA6Pd8Tkr/lBrSQZm9mWb8jnC UTo1VeGyRJFNQUtC+xE1sYgyZgf9pY4ziNT5BtN8bQLAtaQohAHVyRihAadQbuFgekaL Dw2n4MWGX0SWxsY8C4b4hhadBIq9+NQM4jOsT2eM559QawVIN0JyK0/j/ESGZYrL2wRb 0zHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721295771; x=1721900571; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pEYeKFQdTCmcOZCo3uUCM5ivfJOZuWaOvAF6V6Er+ic=; b=muDmQrVfnl41icRV4IXMuSUnjhVsqOBnlwmyeuU3nMgm45m4BDn31QsicXi50Tsl6Z IqTSMeU0Vqky3gqT++Ajy/BwvCJ8K+A3ILEgTmS4glYtYtXepfYkTWzndR0rALgAYx1k BS6FE9eqGVdBmyYDxXyWJuWEEPsjLbgGnZJN+FZvTEYYVmh8e4jTRA7nQjXzX1rDD+Td B6znFM2AMlzCIAWkg4r/xjIIqhiOgutsWVK2/FTe95cY4XlPXWFAUxtCopmDJEFUIKbL SqWJ+arSWM01Z+PtZrU8xOjdbpUslJlQknusGLzKn2652XaCvuu+VzZgB6sAbmmuxtoh FM2g== X-Gm-Message-State: AOJu0YxboYIVz2KUdVlTlWO0Sbc9H/qv8QJW92fqdTXQe9RboX4eWLwf EUa7UD/HmeTml968oMr3sPIWp4ov5mMFgbKaQRzYHEGWTpHboBxHAA4Pi1MRLDJ3VunQOsFpJfe EHgeCG7aP4rmOEsY1IGa+d/esI+o= X-Google-Smtp-Source: AGHT+IFuYtqfzQfINF3P9Pfb274iTpCPpWPbdOfCcQ1IBI+gVfR/mpceR4QY+hg31VtrWEATRoBwQwCKojW3KB7Z1sA= X-Received: by 2002:a05:6102:5e8b:b0:48f:1564:f4b3 with SMTP id ada2fe7eead31-491597fc2eamr6738715137.6.1721295771079; Thu, 18 Jul 2024 02:42:51 -0700 (PDT) MIME-Version: 1.0 References: <937562047.1752859.1721295502145.ref@mail.yahoo.com> <937562047.1752859.1721295502145@mail.yahoo.com> In-Reply-To: <937562047.1752859.1721295502145@mail.yahoo.com> From: Kashif Zeeshan Date: Thu, 18 Jul 2024 14:42:41 +0500 Message-ID: Subject: Re: Re. Select with where condition times out To: "sivapostgres@yahoo.com" Cc: Postgresql General Group Content-Type: multipart/alternative; boundary="000000000000fd19b8061d8266d1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fd19b8061d8266d1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi It can be caused due to Table Bloat, table bloat can slow down queries. Use the pg_repack extension or VACUUM FULL to try ti fix this table bloat issue= . You can refer to following link https://supabase.com/blog/postgres-bloat Regards Kashif Zeeshan On Thu, Jul 18, 2024 at 2:38=E2=80=AFPM sivapostgres@yahoo.com < sivapostgres@yahoo.com> wrote: > Hello, > PG V11 > > Select count(*) from table1 > Returns 10456432 > > Select field1, field2 from table1 where field3> '2024-07-18 12:00:00' > Times out > > The above query was working fine for the past 2 years. > > Backup was taken a day back. Need to recover complete data as far as > possible. > > Any possible way(s) to do this? > > BKR Sivaprakash > > > Yahoo Mail: Search, organise, conquer > > --000000000000fd19b8061d8266d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

It can be caused due to Table Bloat,= table bloat can slow down queries. Use the pg_repack extension or VACUUM F= ULL to try ti fix this table bloat issue.
You can refer to follow= ing link

Rega= rds
Kashif Zeeshan

On Thu, Jul 18, 2024 at 2:38=E2=80=AFPM <= a href=3D"mailto:sivapostgres@yahoo.com">sivapostgres@yahoo.com <sivapostgres@yahoo.com> wrote= :
Hello,
PG = V11

Select count(*) from table1
Returns = 10456432

Select field1, field2 from table1 where f= ield3> '2024-07-18 12:00:00'=C2=A0
Times out

The above query was working fine for the past 2 years.=C2= =A0=C2=A0

Backup was taken a day back.=C2=A0 Need = to recover complete data as far as possible.

Any p= ossible way(s) to do this?

BKR Sivaprakash=C2=A0


<= a id=3D"m_2602144116742344041ymail_android_signature_link" href=3D"https://= mail.onelink.me/107872968?pid=3DNativePlacement&c=3DGlobal_Acquisition_= YMktg_315_EmailSignatureGrowth_YahooMail:Search,Organize,Conquer&af_sub= 1=3DAcquisition&af_sub2=3DGlobal_YMktg&af_sub3=3D&af_sub4=3D100= 000945&af_sub5=3DOrganizeConquer__Static_" target=3D"_blank">Yahoo Mail= : Search, organise, conquer
--000000000000fd19b8061d8266d1--