Postgres respond after toomany times to a query view

Started by Claudia D'amatoabout 22 years ago4 messages
#1Claudia D'amato
claudia.damato@allaxia.com

Hi, I am developing a program using postgres and linux like operating
system. My problem is this:
I have a quite complicated view with roughly 10000 record. When I execute a
simple query like this
"select * from myview"
postgres respond after 50 - 55 minutes roughly. I hope that someone can help
me with some suggestion about reason of this behavior and some solution to
reduce time ti have results. Thank you for your attentions and I hope to
receive some feedback as soon as possible

#2Dann Corbit
DCorbit@connx.com
In reply to: Claudia D'amato (#1)
Re: Postgres respond after toomany times to a query view

I suspect if you do "explain" against the SQL of the view, the answer
will be apparent.

Donning my "Karnak the magnificent hat {borrowed from Johnny Carson}":
You are missing an index.

For the best help, post the SQL of your view, and also the Schema
definition for the tables involved.

-----Original Message-----
From: Claudia D'amato [mailto:claudia.damato@allaxia.com]
Sent: Tuesday, December 16, 2003 2:32 AM
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] Postgres respond after toomany times to a
query view

Hi, I am developing a program using postgres and linux like
operating system. My problem is this:
I have a quite complicated view with roughly 10000 record. When
I execute a simple query like this
"select * from myview"
postgres respond after 50 - 55 minutes roughly. I hope that
someone can help me with some suggestion about reason of this behavior
and some solution to reduce time ti have results. Thank you for your
attentions and I hope to receive some feedback as soon as possible

#3Hannu Krosing
hannu@tm.ee
In reply to: Dann Corbit (#2)
Re: Postgres respond after toomany times to a query view

Dann Corbit kirjutas T, 16.12.2003 kell 12:40:

I suspect if you do "explain" against the SQL of the view, the answer
will be apparent.

Donning my "Karnak the magnificent hat {borrowed from Johnny Carson}":
You are missing an index.

For the best help, post the SQL of your view, and also the Schema
definition for the tables involved.

Also, the best place for asking about performance is the
pgsql-performance list :)

------------
Hannu

#4Richard Huxton
dev@archonet.com
In reply to: Claudia D'amato (#1)
Re: Postgres respond after toomany times to a query view

On Tuesday 16 December 2003 10:32, Claudia D'amato wrote:

I have a quite complicated view with roughly 10000 record. When I execute a
simple query like this
"select * from myview"
postgres respond after 50 - 55 minutes roughly. I hope that someone can
help me with some suggestion about reason of this behavior and some
solution to reduce time ti have results. Thank you for your attentions and
I hope to receive some feedback as soon as possible

Hi Claudio - you don't want the hackers list, you probably want the
performance list. You will want to do the following first:

1. VACUUM ANALYZE the tables used by the view.
2. Provide the output of EXPLAIN ANALYSE SELECT * FROM myview;
3. Provide the definitions of the tables used, and how many rows are in each
table.

I'll see you on the performance list, and we'll see if we can't help you this
afternoon.

--
Richard Huxton
Archonet Ltd