All pastes #801851 Raw Edit

Anonymous

public sql v1 · immutable
#801851 ·published 2007-11-29 17:20 UTC
rendered paste body
EXPLAIN ANALYZE     SELECT                            artist.id,                            artist.name         AS artist,                            artist.gid          AS artist_gid,                            track.artist        AS track_artist                    FROM                        artist                    INNER JOIN track ON track.artist = artist.id                    WHERE lower(artist.name) = 'beck'QUERY PLANHash Join  (cost=5687.20..211232.46 rows=29520 width=66) (actual time=123.623..15661.548 rows=1969 loops=1)  Hash Cond: ("outer".artist = "inner".id)  ->  Seq Scan on track  (cost=0.00..146238.03 rows=5901203 width=4) (actual time=5.239..11441.768 rows=5901203 loops=1)  ->  Hash  (cost=5683.20..5683.20 rows=1600 width=62) (actual time=73.017..73.017 rows=0 loops=1)        ->  Index Scan using artist_lower on artist  (cost=0.00..5683.20 rows=1600 width=62) (actual time=72.992..73.002 rows=1 loops=1)              Index Cond: (lower((name)::text) = 'beck'::text)Total runtime: 15663.956 ms7 rij(en)Total runtime: 15,671.122 msEXPLAIN ANALYZE     SELECT                            artist.id,                            artist.name         AS artist,                            artist.gid          AS artist_gid,                            track.artist        AS track_artist                    FROM                        artist                    LEFT JOIN track ON track.artist = artist.id                    WHERE lower(artist.name) = 'beck'QUERY PLANMerge Left Join  (cost=1156952.71..1186761.93 rows=29520 width=66) (actual time=122427.810..122437.096 rows=1969 loops=1)  Merge Cond: ("outer".id = "inner".artist)  ->  Sort  (cost=5768.35..5772.35 rows=1600 width=62) (actual time=68.304..68.305 rows=1 loops=1)        Sort Key: artist.id        ->  Index Scan using artist_lower on artist  (cost=0.00..5683.20 rows=1600 width=62) (actual time=68.093..68.106 rows=1 loops=1)              Index Cond: (lower((name)::text) = 'beck'::text)  ->  Sort  (cost=1151184.36..1165937.37 rows=5901203 width=4) (actual time=122275.353..122302.250 rows=22698 loops=1)        Sort Key: track.artist        ->  Seq Scan on track  (cost=0.00..146238.03 rows=5901203 width=4) (actual time=5.217..20121.385 rows=5901203 loops=1)Total runtime: 123052.018 ms10 rij(en)Total runtime: 123,059.301 ms