Re: Postgresql 8.0 RC1 not using indexes

Lists: pgsql-bugs
From: Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Postgresql 8.0 RC1 not using indexes
Date: 2004-12-18 04:28:20
Message-ID: 41C3B1E4.7040002@amsoftwaredesign.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,
I just installed 8.0 RC1 and then restored my database which was working
perfectly on 7.4.5.
I have a function that imports rows from a comma seperated file and on
7.4.5 using this same function I could get around 1000 rows every 2.5
seconds, now with 8.0 RC1 this has gone way up and it seems to be
because it is not using the indexes defined on the table.
The reason I believe this is that as the progresses the size of the
table increases and the time for every 1000 rows grows.
by the time I am up to 20000 rows it is taking over 30 seconds per 1000
rows.
I commit the transaction after every 1000 and on 7.4.5 there were no
issues.

The function in question does some selects on the table that is being
inserted and without the indexes working it ends up taking a very long time.

unfortunatly I can't supppy any of the plpgsql function code.


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Postgresql 8.0 RC1 not using indexes
Date: 2004-12-18 07:13:53
Message-ID: 20041218071353.GA7600@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Fri, Dec 17, 2004 at 10:28:20PM -0600, Tony Caduto wrote:

> The function in question does some selects on the table that is being
> inserted and without the indexes working it ends up taking a very long time.
>
> unfortunatly I can't supppy any of the plpgsql function code.

Can you at least post the EXPLAIN ANALYZE output for a query that
you think isn't using an index?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Postgresql 8.0 RC1 not using indexes
Date: 2004-12-18 17:22:35
Message-ID: 2439.1103390555@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com> writes:
> I just installed 8.0 RC1 and then restored my database which was working
> perfectly on 7.4.5.
> I have a function that imports rows from a comma seperated file and on
> 7.4.5 using this same function I could get around 1000 rows every 2.5
> seconds, now with 8.0 RC1 this has gone way up and it seems to be
> because it is not using the indexes defined on the table.

Have you done an ANALYZE or VACUUM ANALYZE since loading the data?

regards, tom lane


From: Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Postgresql 8.0 RC1 not using indexes
Date: 2004-12-19 03:37:44
Message-ID: 41C4F788.1030900@amsoftwaredesign.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi Tom,
Yes I did a vacuum analyse right away. As a further test I restored
the exact same data on another 7.4.5 server and even without a vacuum
analyse the importer program worked as expected(fast).
I posted some more info including screen shots of the importer running
in verbose mode on a 7.4.5 and a 8.0rc1 server, and much more info. I
actually think I have it narrowed down to a select count(*) in my
importer function. It seems that the select count(*) is not using the
indexes that I have defined. This same process has been in production
since June 04 and the indexes have not been changed or deleted. On
monday I am going to replace the count(*) with a for select and a
counter variable and see if the slowness goes away. It really does seem
to be some issue/bug maybe or just a difference in the 8.0 engine.

Thanks,

Tony Caduto

Tom Lane wrote:

>Tony Caduto <tony(dot)caduto(at)amsoftwaredesign(dot)com> writes:
>
>
>>I just installed 8.0 RC1 and then restored my database which was working
>>perfectly on 7.4.5.
>>I have a function that imports rows from a comma seperated file and on
>>7.4.5 using this same function I could get around 1000 rows every 2.5
>>seconds, now with 8.0 RC1 this has gone way up and it seems to be
>>because it is not using the indexes defined on the table.
>>
>>
>
>Have you done an ANALYZE or VACUUM ANALYZE since loading the data?
>
> regards, tom lane
>
>
>
>
>