Re: [GENERAL] Can you spot the difference?

2013-04-17 Thread Moshe Jacobson
On Tue, Apr 16, 2013 at 7:29 PM, Adrian Klaver adrian.kla...@gmail.comwrote: The autovacuum daemon, if enabled, will automatically issue ANALYZE commands whenever the content of a table has changed sufficiently. However, administrators might prefer to rely on manually-scheduled ANALYZE

Re: [GENERAL] Can you spot the difference?

2013-04-17 Thread Adrian Klaver
On 04/17/2013 07:49 AM, Moshe Jacobson wrote: On Tue, Apr 16, 2013 at 7:29 PM, Adrian Klaver adrian.kla...@gmail.com mailto:adrian.kla...@gmail.com wrote: The autovacuum daemon, if enabled, will automatically issue ANALYZE commands whenever the content of a table has changed

[GENERAL] Can you spot the difference?

2013-04-16 Thread Moshe Jacobson
Hi PostgreSQL friends, I have two databases in the same cluster that are almost identical. One is a copy of the other as we are developing some new features in the copy. My problem is that the exact same simple query performs great in the original database (ises) and dismally in the copy

Re: [GENERAL] Can you spot the difference?

2013-04-16 Thread Adrian Klaver
On 04/16/2013 12:07 PM, Moshe Jacobson wrote: Hi PostgreSQL friends, I have two databases in the same cluster that are almost identical. One is a copy of the other as we are developing some new features in the copy. My problem is that the exact same simple query performs great in the original

Re: [GENERAL] Can you spot the difference?

2013-04-16 Thread Tom Lane
Moshe Jacobson mo...@neadwerx.com writes: My problem is that the exact same simple query performs great in the original database (ises) and dismally in the copy database (ises_coelacanth). The problem is that in ises, it uses an index scan, but in ises_coelacanth it uses a sequential scan:

Re: [GENERAL] Can you spot the difference?

2013-04-16 Thread Moshe Jacobson
That was it! Thanks Adrian and Tom! On Tue, Apr 16, 2013 at 3:29 PM, Adrian Klaver adrian.kla...@gmail.comwrote: On 04/16/2013 12:07 PM, Moshe Jacobson wrote: Hi PostgreSQL friends, I have two databases in the same cluster that are almost identical. One is a copy of the other as we are

Re: [GENERAL] Can you spot the difference?

2013-04-16 Thread Igor Neyman
) could have bad statistics as well. That could cause different execution plans. Regards, Igor Neyman From: Moshe Jacobson [mailto:mo...@neadwerx.com] Sent: Tuesday, April 16, 2013 3:07 PM To: pgsql-general Subject: Can you spot the difference? Hi PostgreSQL friends, I have two databases in the same

Re: [GENERAL] Can you spot the difference?

2013-04-16 Thread Moshe Jacobson
On Tue, Apr 16, 2013 at 3:29 PM, Adrian Klaver adrian.kla...@gmail.comwrote: Given that the copy is causing the 'problem', the question to ask is; did you run ANALYZE on the table once the data was copied in? I did not -- I expected the autovacuum daemon to do so. Why did it not? The database

Re: [GENERAL] Can you spot the difference?

2013-04-16 Thread Adrian Klaver
On 04/16/2013 01:55 PM, Moshe Jacobson wrote: On Tue, Apr 16, 2013 at 3:29 PM, Adrian Klaver adrian.kla...@gmail.com mailto:adrian.kla...@gmail.com wrote: Given that the copy is causing the 'problem', the question to ask is; did you run ANALYZE on the table once the data was copied in?