Thread: Query time
Hi, I think im specting problems with a 7.4.8 postgres database. Sometimes some big query takes between 5 to 15 seconds. It happens sometimes all the day it does not depend if database is busy. I have measured that sentence in 15 - 70 ms in normal circunstances. Why sometimes its takes too much time? How can I fix it? Is a postgres version problem, database problem or query problem? Any ideas will be apreciatted. Ruben Rubio
There is not possibility to use another database. It's the best option I have seen. We have been working in postgres in last 3 years, and this is the first problem I have seen. (The database is working in a large website, 6.000 visits per day in a dedicated server) Any other idea? Chethana, Rao (IE10) wrote: >USUALLY POSTGRES DATABASE TAKES MORE TIME, COMPARED TO OTHER DATABASES. >HOWEVER U CAN FINETUNE THE PERFORMANCE OF POSTGRESQL. >IF U HAVE AN OPTION GO FOR SQLITE, MYSQL OR FIREBIRD. > >-----Original Message----- >From: pgsql-performance-owner@postgresql.org >[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Ruben Rubio >Rey >Sent: Friday, March 10, 2006 2:06 AM >To: pgsql-performance@postgresql.org >Subject: [PERFORM] Query time > >Hi, > >I think im specting problems with a 7.4.8 postgres database. > >Sometimes some big query takes between 5 to 15 seconds. It happens >sometimes all the day it does not depend if database is busy. > >I have measured that sentence in 15 - 70 ms in normal circunstances. > >Why sometimes its takes too much time? >How can I fix it? >Is a postgres version problem, database problem or query problem? > >Any ideas will be apreciatted. > >Ruben Rubio > > > >---------------------------(end of broadcast)--------------------------- >TIP 6: explain analyze is your friend > > > >
On Fri, Mar 10, 2006 at 11:05:57AM +0100, Ruben Rubio Rey wrote: > Sometimes some big query takes between 5 to 15 seconds. It happens > sometimes all the day it does not depend if database is busy. > > I have measured that sentence in 15 - 70 ms in normal circunstances. Is it the *exact* same query, including the values you're querying for? The same query with different values can run with different plans depending on row count estimates. It might be useful to see the query string and the EXPLAIN ANALYZE output for a fast query and a slow one. How many tables are you querying? Might you be hitting geqo_threshold (default 12)? If so then the following thread might be helpful: http://archives.postgresql.org/pgsql-performance/2006-01/msg00132.php -- Michael Fuhr
Michael Fuhr wrote: >On Fri, Mar 10, 2006 at 11:05:57AM +0100, Ruben Rubio Rey wrote: > > >>Sometimes some big query takes between 5 to 15 seconds. It happens >>sometimes all the day it does not depend if database is busy. >> >>I have measured that sentence in 15 - 70 ms in normal circunstances. >> >> > >Is it the *exact* same query, including the values you're querying >for? The same query with different values can run with different >plans depending on row count estimates. It might be useful to see >the query string and the EXPLAIN ANALYZE output for a fast query >and a slow one. > >How many tables are you querying? Might you be hitting geqo_threshold >(default 12)? If so then the following thread might be helpful: > >http://archives.postgresql.org/pgsql-performance/2006-01/msg00132.php > > > The querys that are failing are very similar. But, when I see the warning in logs files, I take that query and try it, and takes a few miliseconds (as spected). That query one table on FROM and 2 or 3 on WHERE clause. Rigth now Im using the default server configuration for geqo_threshold, but i'll ckeck the link that u provide me.
Ruben Rubio Rey wrote: > Hi, > > I think im specting problems with a 7.4.8 postgres database. > > Sometimes some big query takes between 5 to 15 seconds. It happens > sometimes all the day it does not depend if database is busy. > > I have measured that sentence in 15 - 70 ms in normal circunstances. > > Why sometimes its takes too much time? > How can I fix it? > Is a postgres version problem, database problem or query problem? Information, Ruben - we can't do anything without information. -- Richard Huxton Archonet Ltd
On Fri, Mar 10, 2006 at 11:29:53AM +0100, Ruben Rubio Rey wrote: > There is not possibility to use another database. It's the best option I > have seen. We have been working in postgres in last 3 years, and this is > the first problem I have seen. (The database is working in a large > website, 6.000 visits per day in a dedicated server) > > Any other idea? > > > Chethana, Rao (IE10) wrote: > > >USUALLY POSTGRES DATABASE TAKES MORE TIME, COMPARED TO OTHER DATABASES. > >HOWEVER U CAN FINETUNE THE PERFORMANCE OF POSTGRESQL. > >IF U HAVE AN OPTION GO FOR SQLITE, MYSQL OR FIREBIRD. If I were you I wouldn't believe any performance recommendations from someone who can't find their caps-lock key or spell "you". The fact is, on any meaningful benchmark current versions of PostgreSQL are on par with other databases. Any benchmark that shows PostgreSQL to be 'slow' is almost certain to be very old and/or does a very poor job of reflecting how client-server databases are normally used. The one caveat is that PostgreSQL is often overkill for single user embedded database type apps. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
Richard Huxton wrote: > Ruben Rubio Rey wrote: > >> Hi, >> >> I think im specting problems with a 7.4.8 postgres database. >> >> Sometimes some big query takes between 5 to 15 seconds. It happens >> sometimes all the day it does not depend if database is busy. >> >> I have measured that sentence in 15 - 70 ms in normal circunstances. >> >> Why sometimes its takes too much time? >> How can I fix it? >> Is a postgres version problem, database problem or query problem? > > > Information, Ruben - we can't do anything without information. > What usefull information could I provide?
>> Information, Ruben - we can't do anything without information. >> > What usefull information could I provide? Offending queries, EXPLAIN ANALYZE, tables description, condiguration parameters, hardware, intended use...
unsubscribe