pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sumeet <asumeet@gmail.com>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: slow query
Date: Wed, 4 Apr 2007 23:17:54 -0400
Message-ID: <7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com> (raw)

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

view thread (11+ messages)  latest in thread

Message-ID: <7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com>
Permalink:  ../7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com/
Also on:    postgresql.org/message-id/7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: asumeet@gmail.com
  Subject: Re: slow query
  In-Reply-To: <7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox