pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Query optimization
Date: Tue, 28 Oct 2014 18:46:28 -0700 (PDT)
Message-ID: <1414547188335-5824744.post@n5.nabble.com> (raw)
In-Reply-To: <CAMhtMNNTDmcTXZ8yjyxtaXvaYYaW04_tnqXRqajH=Kz1Dswmtw@mail.gmail.com>
References: <CAMhtMNNTDmcTXZ8yjyxtaXvaYYaW04_tnqXRqajH=Kz1Dswmtw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

Jorge Arévalo-2 wrote
> So, I first generate a common table records_to_insert, using data from
> table1 and table2, and then call a function fill_table3_function, in order
> to insert the values into table3 (I do more things apart from insert,
> that's reason to call a function instead of just raising an insert query).
> There are indexes created on all the columns that need them.

I would suggest you figure out how to do what you need without pushing the
insert into the function.


> So, is there anything obviously wrong with my query? Any changes to make
> it
> faster?

You shouldn't expect much useful help when the important part of your query
is not provided.

Creating arrays and hstores is expensive but whether that is the biggest
factor is impossible to tell.

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Query-optimization-tp5824739p5824744.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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



view thread (48+ messages)  latest in thread

Message-ID: <1414547188335-5824744.post@n5.nabble.com>
Permalink:  ../1414547188335-5824744.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1414547188335-5824744.post@n5.nabble.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 using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: Query optimization
  In-Reply-To: <1414547188335-5824744.post@n5.nabble.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