Re: [GENERAL] Are indexes blown?

2008-02-18 Thread Andrew Sullivan
On Sat, Feb 16, 2008 at 12:38:04PM +0800, Phoenix Kiula wrote: My hosting provider tells me that the Postgresql server is taking up a lot of memory but I've been running the same db with the same config for over 2 years. Yes we have been growing but what happened in the last 3 days to warrant

Re: [GENERAL] Are indexes blown?

2008-02-18 Thread Andrew Sullivan
On Fri, Feb 15, 2008 at 09:09:32PM +0800, Phoenix Kiula wrote: Actually my host has just told me that I have a number of hung semaphores in my server. And he is relating them to postgresql. I am not surprised, because this is the only utility that has issues. All the rest is working (apache,

Re: [GENERAL] Are indexes blown?

2008-02-16 Thread Phoenix Kiula
On 17/02/2008, Andrej Ricnik-Bay [EMAIL PROTECTED] wrote: On 16/02/2008, Greg Smith [EMAIL PROTECTED] wrote: top -bc | tee topdata That will save everything to a file called topdata while also letting you watch it scroll by. Not as easy to catch the bad periods that way, the output is

Re: [GENERAL] Are indexes blown?

2008-02-16 Thread Phoenix Kiula
On 17/02/2008, Shashank Tripathi [EMAIL PROTECTED] wrote: On 17/02/2008, Andrej Ricnik-Bay [EMAIL PROTECTED] wrote: On 17/02/2008, Phoenix Kiula [EMAIL PROTECTED] wrote: ~ top -b -d 1 | awk -f top.awk | tee topdata awk: top.awk:24: for(i=8;ilast;i++ awk: top.awk:24:

Re: [GENERAL] Are indexes blown?

2008-02-16 Thread Andrej Ricnik-Bay
On 17/02/2008, Phoenix Kiula [EMAIL PROTECTED] wrote: But this is kind of sitting there, hogging the command prompt. Is there any way I can let it go on in the background? Ouch ... no, that's entirely my fault, wasn't quite awake I guess, and hadn't thought it through completely ... that's not

[GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
Hi, I have an index on the user_id field in the query below: myuser=# delete from clients where user_id like '64.22.91.%'; DELETE 22 Time: 220324.975 ms Is there any reason why it's taking 220 seconds to run this simple query? There are about 3 million rows in this table. How can I

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Shoaib Mir
On Fri, Feb 15, 2008 at 3:55 PM, Phoenix Kiula [EMAIL PROTECTED] wrote: Hi, I have an index on the user_id field in the query below: myuser=# delete from clients where user_id like '64.22.91.%'; DELETE 22 Time: 220324.975 ms Is there any reason why it's taking 220 seconds to run

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Richard Huxton
Phoenix Kiula wrote: Hi, I have an index on the user_id field in the query below: myuser=# delete from clients where user_id like '64.22.91.%'; DELETE 22 Time: 220324.975 ms Is there any reason why it's taking 220 seconds to run this simple query? There are about 3 million rows in

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
On 15/02/2008, Shoaib Mir [EMAIL PROTECTED] wrote: On Fri, Feb 15, 2008 at 3:55 PM, Phoenix Kiula [EMAIL PROTECTED] wrote: Hi, I have an index on the user_id field in the query below: myuser=# delete from clients where user_id like '64.22.91.%'; DELETE 22 Time: 220324.975

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: First guess is that it's not using the index. What does EXPLAIN ANALYSE SELECT user_id FROM clients WHERE user_id LIKE '...' show? Check the list archives for locale and like and text_pattern_ops too - that's a good place to check.

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Richard Huxton
Phoenix Kiula wrote: On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: First guess is that it's not using the index. What does EXPLAIN ANALYSE SELECT user_id FROM clients WHERE user_id LIKE '...' show? Check the list archives for locale and like and text_pattern_ops too - that's a

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
Actually my host has just told me that I have a number of hung semaphores in my server. And he is relating them to postgresql. I am not surprised, because this is the only utility that has issues. All the rest is working (apache, mysql, exim, etc). Any thoughts on where I should start looking for

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Shoaib Mir
On Fri, Feb 15, 2008 at 5:18 PM, Phoenix Kiula [EMAIL PROTECTED] wrote: How should I install a contrib without bringing down my database, or stopping it, or doing ANYTHING to it? It's in production. I can't touch it. Will it be installed on the side and then I simply start using it?

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Shoaib Mir
On Fri, Feb 15, 2008 at 6:13 PM, Phoenix Kiula [EMAIL PROTECTED] wrote: Thanks. But I had installed from rpm. Can I just download that .so file and put in the lib folder for pgsql and then start using it? Well I would say download the source for the same version you have, copy it to your

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
On 15/02/2008, Shoaib Mir [EMAIL PROTECTED] wrote: You do not need to restart the database server for that purpose as all you need is the pgstattuple.so file copied to PG-HOME/lib folder. Do the following (in case you have installed server from source): - Go to the

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Richard Huxton
Phoenix Kiula wrote: On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: Ah, more new information! This does seem to point to the load, particularly if it's exactly the same query each time. So what do top/vmstat etc show for these go-slow periods? In included top and vmstat info in my

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Harald Fuchs
In article [EMAIL PROTECTED], Shoaib Mir [EMAIL PROTECTED] writes: On Fri, Feb 15, 2008 at 6:13 PM, Phoenix Kiula [EMAIL PROTECTED] wrote: Thanks. But I had installed from rpm. Can I just download that .so file and put in the lib folder for pgsql and then start using it? Well I

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Douglas McNaught
On 2/15/08, Harald Fuchs [EMAIL PROTECTED] wrote: But you have to ensure that you build PostgreSQL on your desktop machine in exactly the same way as the RPM got built (integer_datetimes etc). It'd probably be much easier to just install the -contrib RPM. :) -- -Doug

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Douglas McNaught
On 2/15/08, Phoenix Kiula [EMAIL PROTECTED] wrote: LOG: could not receive data from client: Connection reset by peer LOG: unexpected EOF on client connection LOG: could not receive data from client: Connection reset by peer LOG: unexpected EOF on client connection This means your

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Scott Marlowe
On Fri, Feb 15, 2008 at 8:36 AM, Phoenix Kiula [EMAIL PROTECTED] wrote: No. They are the vmstat figures from when I was replying to your email. What will vmstat tell me and how should I set it up to do vmstat 10 logging? Something like vmstat 10 vmstat.log LOG: could not receive data

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Richard Huxton
Phoenix Kiula wrote: On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: Are you sure the two sets of vmstat/top figures are from when PG was crashing/running queries slow? Everything seems idle to me in those figures. No. They are the vmstat figures from when I was replying to your

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: Phoenix Kiula wrote: On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: Ah, more new information! This does seem to point to the load, particularly if it's exactly the same query each time. So what do top/vmstat etc show

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: Phoenix Kiula wrote: On 15/02/2008, Richard Huxton [EMAIL PROTECTED] wrote: Are you sure the two sets of vmstat/top figures are from when PG was crashing/running queries slow? Everything seems idle to me in those figures.

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Phoenix Kiula
On 16/02/2008, Greg Smith [EMAIL PROTECTED] wrote: On Sat, 16 Feb 2008, Phoenix Kiula wrote: The script you suggested doesn't work: tmp ./trackusage.sh -bash: ./trackusage.sh: /bin/sh: bad interpreter: Permission denied Try changing the first line to #!/bin/bash Thanks

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Greg Smith
On Sat, 16 Feb 2008, Phoenix Kiula wrote: The script you suggested doesn't work: tmp ./trackusage.sh -bash: ./trackusage.sh: /bin/sh: bad interpreter: Permission denied Try changing the first line to #!/bin/bash Anyway, I did the vmstat command. I was running it while the system was

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Scott Marlowe
On Feb 15, 2008 10:38 PM, Phoenix Kiula [EMAIL PROTECTED] wrote: My hosting provider tells me that the Postgresql server is taking up a lot of memory but I've been running the same db with the same config for over 2 years. Yes we have been growing but what happened in the last 3 days to

Re: [GENERAL] Are indexes blown?

2008-02-15 Thread Greg Smith
On Sat, 16 Feb 2008, Phoenix Kiula wrote: The top output shows httpd on top, and sometimes postmaster, but I don't know how to repeatedly capture it. Any suggestions? Try this: top -bc | tee topdata That will save everything to a file called topdata while also letting you watch it scroll