Re: [PERFORM] Select hangs and there are lots of files in table and index directories.

2014-01-27 Thread Tom Lane
Peter Blair writes: > Have a problem where a stored procedure is taking a week to run. The > stored procedure should take less than a second to run. Is that "it's known to terminate if you give it a week", or "we've let it run for a week and it shows no sign of ever terminating"? > In researchi

[PERFORM] Select hangs and there are lots of files in table and index directories.

2014-01-27 Thread Peter Blair
Have a problem where a stored procedure is taking a week to run. The stored procedure should take less than a second to run. In researching a select hanging problem, three things are suggested; an autovacuum problem, a resource is locked, or there is something wrong with the stored procedure. ·

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Gavin Flower
On 28/01/14 08:10, bobJobS wrote: My developers have had the same issue. Postgres 9.2.3 on Linux 5.6. The latest Linux kernel is 3.13 (https://www.kernel.org), so I assume 5.6 is a distribution version. So which distribution of Linux are you using? Cheers, Gavin -- Sent via pgsql-perform

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread bobJobS
My developers have had the same issue. Postgres 9.2.3 on Linux 5.6. The query planner estimates (for 27 table join SQL) that using the nestloop is faster, when in fact it is not. A hashjoin returns results faster. We've set enable_nestloop = false and have gotten good results. The problem is, nes

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread salah jubeh
Hello Stelian,  Have you tried to use func_table module?, I think it will help you to eliminate all the joins. Regards On Monday, January 27, 2014 5:54 PM, Stelian Iancu wrote: Hello, I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a fairly large database (some table

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Stelian Iancu
On Mon, Jan 27, 2014, at 7:06, Tom Lane wrote: > Stelian Iancu writes: > > I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a > > fairly large database (some tables with approx. 1 mil. records) and I > > have the following query: > > [ 13-way join joined to a 3-way join ] > >

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Stelian Iancu
On Mon, Jan 27, 2014, at 9:20, salah jubeh wrote: > Hello Stelian,  > Hello, > Have you tried to use func_table module?, I think it will help you to > eliminate all the joins. No, I haven't. I can have a look later, thanks. > > Regards > > -- Sent via pgsql-performance mailing list (p

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Tom Lane
Stelian Iancu writes: > I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a > fairly large database (some tables with approx. 1 mil. records) and I > have the following query: > [ 13-way join joined to a 3-way join ] Think you'll need to raise join_collapse_limit and from_coll

[PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Stelian Iancu
Hello, I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a fairly large database (some tables with approx. 1 mil. records) and I have the following query: SELECT * FROM ( SELECT DISTINCT c.ext_content_id AS type_1_id, "substring"(c.ext_content_id::text, 1, 13) AS t

Re: [PERFORM] pg_repack solves alter table set tablespace lock

2014-01-27 Thread Alvaro Herrera
Ying He escribió: > Thank you Josh. Won't double post again. Just thought reorg mailing list is > quite inactive. Well, that tells you something about its maintenance state and what sort of help you can expect if you find yourself in trouble with it. -- Álvaro Herrerahttp://www.

Re: [PERFORM] pg_repack solves alter table set tablespace lock

2014-01-27 Thread Ying He
Thank you Josh. Won't double post again. Just thought reorg mailing list is quite inactive. best, Ying On Friday, January 24, 2014 4:43 PM, Josh Kupershmidt wrote: On Fri, Jan 24, 2014 at 3:48 PM, Ying He wrote: I looked at the pg_repack usage and in release 1.2 http://reorg.github.i