[GENERAL] very slow after a while...

2005-04-06 Thread Costin Manda
Hello, I have a machine that uses pgsql version 8.0.1 I don't think the version is relevant because I had 7.4.1 before and I had the same problem. I have a PHP script that runs regularily and does this: select a bunch of lines from a mssql database insert into postgres the values taken if insert

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Richard Huxton
Costin Manda wrote: The thing is the after I updated to 8.0.1 and also (separate ocasion) after I recreated the database one day, the script runs instantly with thousands and hundreds of lines inserted and updated per second. However, after a while the whole process slows down significantly,

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Richard Huxton
Please CC the list as well as replying directly - it means more people can help. Costin Manda wrote: Some more info please: 1. This is this one INSERT statement per transaction, yes? If that fails, you do an UPDATE correct. 2. Are there any foreign-keys the insert will be checking? 3. What

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Costin Manda
Some more info please: 1. This is this one INSERT statement per transaction, yes? If that fails, you do an UPDATE correct. 2. Are there any foreign-keys the insert will be checking? 3. What indexes are there on the main table/foreign-key-related tables? this is the table, the only

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Costin Manda
I think I found the problem. I was comparing wrongly some values and based on that, every time the script was run (that means once every 5 minutes) my script deleted two tables and populated them with about 70 thousand records. I still don't know why that affected the speed of the database

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Richard Huxton
Costin Manda wrote: I think I found the problem. I was comparing wrongly some values and based on that, every time the script was run (that means once every 5 minutes) my script deleted two tables and populated them with about 70 thousand records. I still don't know why that affected the speed

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Costin Manda
On Wed, 06 Apr 2005 14:07:36 +0100 Richard Huxton dev@archonet.com wrote: Costin Manda wrote: I think I found the problem. I was comparing wrongly some values and based on that, every time the script was run (that means once every 5 minutes) my script deleted two tables and populated

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Richard Huxton
Costin Manda wrote: On Wed, 06 Apr 2005 14:07:36 +0100 Richard Huxton dev@archonet.com wrote: Costin Manda wrote: I think I found the problem. I was comparing wrongly some values and based on that, every time the script was run (that means once every 5 minutes) my script deleted two tables and

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Costin Manda
On Wed, 06 Apr 2005 15:54:29 +0100 Richard Huxton dev@archonet.com wrote: I mean from 5 to 5 minutes DROP TABLE CREATE TABLE INSERT 7 rows in table I thought you were trying an inserting / updating if it failed? You shouldn't have any duplicates if the table was already

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Richard Huxton
Costin Manda wrote: On Wed, 06 Apr 2005 15:54:29 +0100 Richard Huxton dev@archonet.com wrote: I mean from 5 to 5 minutes DROP TABLE CREATE TABLE INSERT 7 rows in table I thought you were trying an inserting / updating if it failed? You shouldn't have any duplicates if the table was already

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Tom Lane
Richard Huxton dev@archonet.com writes: Costin Manda wrote: I thought the problem lied with step 4, but now I see that step 3 was the culprit and that , indeed, I did not do drop table, create table but delete from and inserts. I think that recreating these two tables should solve the

Re: [GENERAL] very slow after a while...

2005-04-06 Thread Ragnar HafstaĆ°
On Wed, 2005-04-06 at 18:18 +0300, Costin Manda wrote: The script does the following thing: 1. read the count of rows in two tables from the mssql database 2. read the count of rows of the 'mirror' tables in postgres these are tables that get updated rarely and have a maximum of 10