Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEuEr-0006E1-HN for pgsql-performance@arkaria.postgresql.org; Wed, 15 Nov 2017 09:44:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eEuEr-0000kV-4z for pgsql-performance@arkaria.postgresql.org; Wed, 15 Nov 2017 09:44:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eEuEp-0000jI-QW for pgsql-performance@postgresql.org; Wed, 15 Nov 2017 09:44:07 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eEuEm-0004GM-W9 for pgsql-performance@postgresql.org; Wed, 15 Nov 2017 09:44:06 +0000 Received: by mail-wm0-x232.google.com with SMTP id 9so1652659wme.4 for ; Wed, 15 Nov 2017 01:44:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eD2PXRAJM9C/MdIBNRiBgz22YLloJF/GmCr3nVv+7k4=; b=YsyFP/zLPfCjrDWKt/rP4MgU+t1kwGffxnE15cZ2BKcv9LGVt2WeLrsNvjUzvaDhPi KjW8KSyXZJDp8okauVBTyan3O6RGcs7SS96Bv6dzi21f00L+gLylYeougN0MkVfURRGq aHpLBEUW4P+rXmsupKyk+tlj/hhE2kV6A4jXi6jd8l2Bd7/pdXWVpwSB8zphYOyOyoCC 02SmTRJIIxIOlQDoaR4xpUsZKliHAje6O6cLcuIVgI6FvZMAKr7gjWMJ117+Ok6PdCWx JTGkQFAfSHYMw/bx4SJeByWLFA0PgaGOx0B75NEdLht15kQWlv0803irurFVc+HYT8AQ /nfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eD2PXRAJM9C/MdIBNRiBgz22YLloJF/GmCr3nVv+7k4=; b=GKSmrytbnCU1u4XZKaTcu9CV7YAoHr/RfC31uhi5PGW85j9DJAIMliaa/ojBzQsy1v 69DFQLvht3SlBdjdT2N8hqk9GsqEsokOt+kAGIz/wDrVx4h82u/6baUZhlDMdQO55lea +Jf3TF0Alv3dwAH/kWx3zWLEhxeRt2a3f1AzNhAFdk/VlechC98xtMeM2W/56DSqT6sD BlJCQrPLjIOVCGXGpmDKItxUtULG1QOTKdLeZDSjrI2eE9HjCyA89p6ewIxohUJcQ/y6 PiIGwrB4Dds1LJkXJ5JfU0nkYu0Z4CU8nl+H6Q54YNcfmoP67blON7vPQnk8z0SfnjLy 4G9g== X-Gm-Message-State: AJaThX4X5aaE9BeflMPvIAR4YcQTuUl/VDWZNIISAl3gxytazzJLU2TB /tMukL6/pmrpswsX9U2w0/6ZyCUb/xME76XaERQ= X-Google-Smtp-Source: AGs4zMZls0atA5C0WF9vR/r9zLbcGWohfF7TKtv1DtLafmYZKODEw07OSlyMEj8ZxFCJci2HCcg/P4y6Sfh45eVMBBk= X-Received: by 10.28.137.80 with SMTP id l77mr5574604wmd.24.1510739043507; Wed, 15 Nov 2017 01:44:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.146.7 with HTTP; Wed, 15 Nov 2017 01:43:23 -0800 (PST) In-Reply-To: References: From: Pavel Stehule Date: Wed, 15 Nov 2017 10:43:23 +0100 Message-ID: Subject: Re: query performance issue To: Samir Magar Cc: "pgsql-performance@postgresql.org" Content-Type: multipart/alternative; boundary="001a11444a200963f2055e02580e" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --001a11444a200963f2055e02580e Content-Type: text/plain; charset="UTF-8" Hi please send EXPLAIN ANALYZE output. Regards Pavel 2017-11-15 10:33 GMT+01:00 Samir Magar : > Hello, > I am having performance issues with one of the query. > The query is taking 39 min to fetch 3.5 mil records. > > I want to reduce that time to 15 mins. > could you please suggest something to its performance? > > server configuration: > CPUs = 4 > memory = 16 GM > shared_buffers = 3 GB > work_mem = 100MB > effective_cache_size = 12 GB > > we are doing the vacuum/analyze regularly on the database. > > attached is the query with its explain plan. > > Thanks, > Samir Magar > > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > > --001a11444a200963f2055e02580e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

please send EXPLAIN ANALYZE= output.

Regards

Pavel

2017-11-15 10:33 GMT+01:00 Samir M= agar <samirmagar8@gmail.com>:
Hello,
I am having performance issues with on= e of the query.
The query is taking 39 min to fetch 3.5 mil recor= ds.

I want to reduce that time to 15 mins.=C2=A0
could you please suggest something to its performance?
<= br>
server configuration:
=C2=A0CPUs =3D 4
me= mory =3D 16 GM
shared_buffers =3D 3 GB
work_mem =3D 100= MB
effective_cache_size =3D 12 GB

we are= doing the vacuum/analyze regularly on the database.=C2=A0

attached is the query with its explain plan.

<= div>Thanks,
Samir Magar=C2=A0=C2=A0


--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pe= rformance


--001a11444a200963f2055e02580e--