check sql progress

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: check sql progress
Date: 2002-03-01 14:00:23
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB0452E024@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howdy:

I'm running Postgres 7.1.3 on RedHat Linux 7.2 kernel
version 2.4.7 rel 10.

Basic SQL questions (I think). I'm trying to write
a query:

[script]

--explain
drop table t_bp_stage9;
create table t_bp_stage9 as
select
lpad (a.member_id::text,10,'0') as bp_member_id,
b.bp_disease_id,
b.bp_measure_id,
b.bp_end_period_id,
b.bp_leg_cust_memb_id,
b.bp_source_code
from
t_bp_test1 a, t_bp_stage8 b
where
cast(a.member_id_legacy_cust as char) = b.bp_leg_cust_memb_id
;
grant select on t_bp_stage9 to public;

[/script]

When I do and explain, I get this:

[explain]

psql:./test2:17: NOTICE: QUERY PLAN:

Nested Loop (cost=0.00..32520.00 rows=10000 width=84)
-> Seq Scan on t_bp_test1 a (cost=0.00..20.00 rows=1000 width=24)
-> Seq Scan on t_bp_stage8 b (cost=0.00..20.00 rows=1000 width=60)

EXPLAIN

[/explain]

I started the job from last night (about 6pm) and had to
kill it when I got in this morning (8am). I know the
data is large (t_bp_stage8 = 8183745 records;
t_bp_test1 =1677375 records) but what I haven't seen
is the partition space where the database lives get smaller
(when ever I create large tables, I check the partition
and, sure enough, the file system loses a bit of space).

My questions: How can I check to see if this query is actually
doing something? Is my query even right? Even though there's
temporary, should I index them and drop them later?

Suggestions?

Thanks!

-X

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Priebe 2002-03-01 14:24:04 Re: About vacuuming
Previous Message Nikolay Mihaylov 2002-03-01 13:38:44 Pg_dump very large database