pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Durgamahesh Manne <maheshpostgres9@gmail.com>
To: pgsql-general@lists.postgresql.org
Cc: Andreas Kretschmer <andreas@a-kretschmer.de>
Subject: Re: Regarding query execution for long time
Date: Mon, 28 Jan 2019 07:16:37 -0800
Message-ID: <dc700960-0477-810a-8b38-40aba8fd93f5@aklaver.com> (raw)
In-Reply-To: <CAJCZkoJgSEQxoJBcci0M-XWYVKQNLfxbVmS5wYgrXqsqS+Yf6Q@mail.gmail.com>
References: <CAJCZkoJgSEQxoJBcci0M-XWYVKQNLfxbVmS5wYgrXqsqS+Yf6Q@mail.gmail.com>

On 1/28/19 4:20 AM, Durgamahesh Manne wrote:
> Hi
> 
> below query is being executed for long time
> 
> Select
> distinct ltrim(rtrim(ssnumber)), CL.iInsightClientId, 
> ltrim(rtrim(TFA.client_account_key)) as vchAccountNumber,
> concat(TFA.first_name, ' ', TFA.last_name) as vchAccountName,
> concat('AP:TIAA', TFA.routing_number) as vchRepLabel,
> null as vchOpenDate, TFA.address1 as vchAccountTiteLine2,
> TFA.address2 as vchAccountTitleLine3,null as vchAccountType,
> TFA.address1 as vchPrimaryContact, 'TIAA-CREF' as Custodian,
> TFA.routing_number as vchCustodian_RepId, null as vchCustodianRepName,
> CONCAT ('TIAA-CREF:',ltrim(rtrim(client_account_key)),':', 
> ltrim(rtrim(ssnumber))) as vchAccountKey,
> null as vchFeedsAccountType
> from accounts as TFA
> join client3 as CL on 
> ltrim(rtrim(Cl.vchssnumber))=ltrim(rtrim(TFA.ssnumber))
> left join account3 as AC on 
> ltrim(rtrim(AC."vchCustodianAccountNumber"))=ltrim(rtrim(TFA.client_account_key))
> where AC."iInsightAccountID" is null;
> 
>   query is being executed for long time even after i have created 
> required indexes on columns of the tables
> please help for fast query execution

See below for information on how to report these sort of issues:

https://wiki.postgresql.org/wiki/SlowQueryQuestions

> 
> Regards
> durgamahesh manne
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (7+ messages)  latest in thread

Message-ID: <dc700960-0477-810a-8b38-40aba8fd93f5@aklaver.com>
Permalink:  ../dc700960-0477-810a-8b38-40aba8fd93f5@aklaver.com/
Also on:    postgresql.org/message-id/dc700960-0477-810a-8b38-40aba8fd93f5@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, maheshpostgres9@gmail.com, andreas@a-kretschmer.de
  Subject: Re: Regarding query execution for long time
  In-Reply-To: <dc700960-0477-810a-8b38-40aba8fd93f5@aklaver.com>
  References: <CAJCZkoJgSEQxoJBcci0M-XWYVKQNLfxbVmS5wYgrXqsqS+Yf6Q@mail.gmail.com> <dc700960-0477-810a-8b38-40aba8fd93f5@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox