Re: [GENERAL] query seems too slow

From: "amy cheng" <amycq(at)hotmail(dot)com>
To: keitt(at)nceas(dot)ucsb(dot)edu, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] query seems too slow
Date: 1999-11-03 11:58:49
Message-ID: 19991103195850.29457.qmail@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

seems that you should have index both for tenstop.route_id and
history.route_id . From the index name, it not clear if you have
or not. No matter what, add indeces!!!

>From: "Timothy H. Keitt" <keitt(at)nceas(dot)ucsb(dot)edu>
>To: pgsql-general(at)postgreSQL(dot)org
>Subject: [GENERAL] query seems too slow
>Date: Wed, 03 Nov 1999 11:17:52 -0800
>
>I'm trying to join two tables, one with > 3M rows and another with a few
>thousand rows, and store the output in a new table. "EXPLAIN" gives the
>following output:
>
>keitt=> explain select tenstop.* into tmp from tenstop, history where
>tenstop.route_id = history.route_id and tenstop.year = history.year and
>history.run_type = 1;
>NOTICE: QUERY PLAN:
>
>Nested Loop (cost=6.15 rows=1 width=56)
> -> Index Scan using history_run_type_index on history (cost=2.05
>rows=2 width=8)
> -> Index Scan using tenstop_year_index on tenstop (cost=2.05
>rows=3316684 width=48)
>
>EXPLAIN
>keitt=>
>
>I fired this off yesterday and it was still not finished this morning
>after 12+ hours. Should I be suprised? How long should a query like
>this take? (This is on a PII 450 w/ 256M ram.)
>
>Tim
>
>--
>Timothy H. Keitt
>National Center for Ecological Analysis and Synthesis
>735 State Street, Suite 300, Santa Barbara, CA 93101
>Phone: 805-892-2519, FAX: 805-892-2510
>http://www.nceas.ucsb.edu/~keitt/
>
>
>
>
>************
>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Natalya S. Makushina 1999-11-03 13:45:08 Problem: pq_recvbuf: unexpected EOF of client connection
Previous Message Stiaan 1999-11-03 09:01:59 Problems installing StarOffice