Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDa4h-00018p-M0 for pgsql-performance@arkaria.postgresql.org; Wed, 24 May 2017 17:27:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dDa4h-0001LM-8z for pgsql-performance@arkaria.postgresql.org; Wed, 24 May 2017 17:27:55 +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 1dDa2v-0006fw-Ex for pgsql-performance@postgresql.org; Wed, 24 May 2017 17:26:05 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dDa2o-00025Y-Ik for pgsql-performance@postgresql.org; Wed, 24 May 2017 17:26:04 +0000 Received: by mail-wm0-x229.google.com with SMTP id 7so70419641wmo.1 for ; Wed, 24 May 2017 10:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=geKzAOjXvknA71yiArmrLaL1kO6LbTyeYflwULo0UGI=; b=Ok6pLMa7BFt4j40eQ+4LL4yRd1yiG4XllxUClnkQDW+tiRQMa5eFfAOKtcgn751tub qlhYssrNkBS5oSP0J9tJ6GEoQbn6zSnMDLbg0p1WXVIxS+6TdytSRCa1egz7iPZtmk/B 90G4fMSRv7vtt46XLLw3rugiXmcwfNSUsKnc+cKo314TgNCoUL9c3o8keQrwhWO0rtNM UrdwdQpa23bHJmsyF43urFu8yzXyYt8DddK+hfMEOkfEOFwTZbfUOSd02b7ah6gpo6bz tk9WHQ9fMIsOae/EpCWZsxOPl2CF2kWjIes7OX7Jqlz72D57OHZ88Apoo2SZZErCBvoV Oihw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=geKzAOjXvknA71yiArmrLaL1kO6LbTyeYflwULo0UGI=; b=PdnngYjN1UwNs/BIMioeZz1KvuWoyn430NCgQi9MR1Z492w701pdrPZhOjyXRv9wRY jDCpqQyDVUr4ccx4JJRgQmBoo1M/LDTWPODVx70dHuRjiBzugR4Y3eOGlM3Yhpfgw63B f1ljTAPLd6iGOyfp9Go7H8O2A0TGfRtp7SlCHrgkMdCWm2fjuBKH6JC4o+0x4uZxm3BB +JQQXaDoQdn0P+6hqJtI1frBD/wuRoOrMtblbeJyU7WM7uuwPdP8FilSen7BU2rJEe9K MtK5W7qpkk/rsqYg6TD++8k1D7jp9yPjMHV0/6PeKpc7CMWhzQziSsHoqk7r9R+niVfY pB8Q== X-Gm-Message-State: AODbwcCx1cJNqi/h1ncIc1smbn5DZkcwaxo6F+I4PyC3DAErJkmt2pWs 22kk3YoZ/rBJmqqSQtxap5v/KxCcsvX8I2vlr54b8MzxSYWQSatf/D5yHfCZGgAmsJPNCnL+Knf CxP+tlZTcUlkipPFJil8yHiiVNoF1nar24Sgi1187hlmSu/gaFk2QY9NsoaqrBj6cKR78GhplRf 09NJB5 X-Received: by 10.28.152.69 with SMTP id a66mr7521596wme.6.1495646756599; Wed, 24 May 2017 10:25:56 -0700 (PDT) Received: from [10.137.2.17] (ip-89-177-46-65.net.upcbroadband.cz. [89.177.46.65]) by smtp.gmail.com with ESMTPSA id l81sm6565416wmi.22.2017.05.24.10.25.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 May 2017 10:25:55 -0700 (PDT) Subject: Re: Query is running very slow...... To: pgsql-performance@postgresql.org References: <3152be5a435f45649cef6bf9321beb9a@cyient.com> From: Tomas Vondra Message-ID: <4caed7cc-07d8-e364-78ca-7a96b9780a9d@2ndquadrant.com> Date: Wed, 24 May 2017 19:25:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Thunderbird/54.0a2 MIME-Version: 1.0 In-Reply-To: <3152be5a435f45649cef6bf9321beb9a@cyient.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 Hi, On 5/24/17 7:04 PM, Dinesh Chandra 12108 wrote: > Dear Expert, > > While executing the blow query, its taking too long time to fetch output. > > Could you please help to fine tune the same? > You'll have to provide far more details - the query alone is certainly not enough for anyone to guess why it's slow. Perhaps look at this: https://wiki.postgresql.org/wiki/Slow_Query_Questions In particular, you'll have to tell us (a) something about the hardware it's running on (b) amounts of data in the tables / databases (c) EXPLAIN or even better EXPLAIN ANALYZE of the query (d) configuration of the database (work_mem, shared_buffers etc.) regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance