Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > seq scan issue....
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 4001 of 4424
Post > Topic >>

seq scan issue...

by kevin@[EMAIL PROTECTED] (kevin kempter) Apr 17, 2008 at 12:24 PM

Hi List;

I have a large tble (playback_device) with 6million rows in it. The  
aff_id_tmp1 table has 600,000 rows.

I also have this query:
select distinct
tmp1.affiliate_id,
tmp1.name,
tmp1.description,
tmp1.create_dt,
tmp1.playback_device_id,
pf.segment_id
from
aff_id_tmp1 tmp1,
playback_fragment pf
where
tmp1.playback_device_id = pf.playback_device_id ;


The Primary Key for playback_device is the playback_device_id
there is also an index on playback_device_id on the aff_id_tmp1 table.
The only join condition I have is on this key pair (I've posted my  
explain plan below)


- why am I still getting a seq scan ?

Thanks in advance.






============
Explain PLan
============

explain
select distinct
tmp1.affiliate_id,
tmp1.name,
tmp1.description,
tmp1.create_dt,
tmp1.playback_device_id,
pf.segment_id
from
aff_id_tmp1 tmp1,
playback_fragment pf
where
tmp1.playback_device_id = pf.playback_device_id ;


  Unique  (cost=2966361.56..3194555.91 rows=10104496 width=97)
    ->  Sort  (cost=2966361.56..2998960.76 rows=13039677 width=97)
          Sort Key: tmp1.affiliate_id, tmp1.name, tmp1.description,  
tmp1.create_dt,
tmp1.playback_device_id, pf.segment_id
          ->  Hash Join  (cost=23925.45..814071.14 rows=13039677  
width=97)
                Hash Cond: (pf.playback_device_id =  
tmp1.playback_device_id)
                ->  Seq Scan on playback_fragment pf   
(cost=0.00..464153.77 rows=130
39677 width=16)
                ->  Hash  (cost=16031.31..16031.31 rows=631531 width=89)
                      ->  Seq Scan on aff_id_tmp1 tmp1   
(cost=0.00..16031.31 rows=63
1531 width=89)
(1068 rows)


-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 3 Posts in Topic:
seq scan issue...
kevin@[EMAIL PROTECTED]   2008-04-17 12:24:26 
Re: seq scan issue...
jwbaker@[EMAIL PROTECTED]  2008-04-17 11:30:15 
Re: seq scan issue...
lists@[EMAIL PROTECTED]   2008-04-18 01:53:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 7:11:36 CST 2008.