slow query

From: Sumeet <asumeet(at)gmail(dot)com>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: slow query
Date: 2007-04-05 03:17:54
Message-ID: 7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all

I ran a simple query like the one displayed below and it takes a lot of time
to execute on this table.
This table has 48 million records....and i worry about this table a lot coz
i need to perform join on this
table with some other table having around 13 million records....I've tried
vacuuming this table many time
but dint help me much...is there any other trick to speed up this
table....once i tried deleting and restoring a table
and it worked perfectly fine for a small table of size upto 5-6 million
records

sm=> explain analyze select * from ma limit 10;
QUERY
PLAN
-------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..0.45 rows=10 width=76) (actual
time=21985.292..22204.340rows=10 loops=1)
-> Seq Scan on ma (cost=0.00..2181956.92 rows=48235392 width=76)
(actual time=21985.285..22204.308 rows=10 loops=1)
Total runtime: 22204.476 ms
(3 rows)

--
Thanks,
Sumeet

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bryce Nesbitt 2007-04-05 04:17:19 Re: Very slow DELETE on 4000 rows of 55000 row table
Previous Message Paul Lambert 2007-04-04 22:20:01 Re: Moving a simple function to pl/pgsql (Novice question)