1

I have a table that included only 472 rows and geometry of table is Multipolygon. I am sending query to database via PgAdmin III

select * from mytable // this query takes 99413 ms

This is a very long time.

What do you think about long queries on PostgreSQL? Server resource, disc, CPU etc.

  • 1
    Maybe it's not the query issue, but data sending time. Try to execute select 1 from mytable - you'll get time closest to time of execution – Jendrusk Aug 5 '14 at 7:59
  • 1
    When asking such things you should do EXPLAIN ANALYZE (postgresql.org/docs/current/static/sql-explain.html) and post result using explain.depesz.com. However in your case the answer is probably: You have few rows but the geoms are huge so it takes a lot of time to send the results to you. – Jakub Kania Aug 5 '14 at 7:59
  • How long does it take to return just one row of the table? – Mark Cupitt Aug 5 '14 at 15:57
  • You need to figure out whether the time is spent reading the table (explain analyze) or sending the rows to the client. – Craig Ringer Aug 6 '14 at 0:24
  • It's not possible to review the quality of your server resources if you don't provide them. You also don't provide key information about the column values (especially number of vertices per feature) and the size and source of the data. Please edit the question. – Vince Nov 7 '16 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.