Re: Query optimization - Mailing list pgsql-general

From David G Johnston
Subject Re: Query optimization
Date
Msg-id 1414547188335-5824744.post@n5.nabble.com
Whole thread Raw
In response to Query optimization  (Jorge Arevalo <jorgearevalo@libregis.org>)
List pgsql-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.


pgsql-general by date:

Previous
From: Romu Hu
Date:
Subject: Re: Need guidance on regression.diffs
Next
From: David G Johnston
Date:
Subject: Re: Query optimization