All pastes #206620 Raw Edit

Anonyme

public sql v1 · immutable
#206620 ·published 2006-10-17 14:10 UTC
rendered paste body
SELECT   _article.id AS article_id,         _blog.id AS blog_id,         _user.id AS user_idFROM      _article INNER JOIN _blog        ON _article.path <@ _blog.pathINNER JOIN _entity_has_element        ON  _entity_has_element.element_id = _blog.idINNER JOIN _user        ON _entity_has_element.entity_id = _user.idWHERE _article.id IN (69, 32407, 66209, 96939, 140396)AND _entity_has_element.role_id    = 5;-----------------------                                                                     QUERY PLAN                                                                      ----------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop  (cost=3520.84..16597.93 rows=1207 width=24) (actual time=1.011..941.924 rows=5 loops=1)   ->  Hash Join  (cost=3520.84..10531.57 rows=1207 width=24) (actual time=0.992..941.832 rows=5 loops=1)         Hash Cond: ("outer".element_id = "inner".id)         ->  Seq Scan on _entity_has_element  (cost=0.00..5791.38 rows=241458 width=16) (actual time=0.014..511.948 rows=242443 loops=1)               Filter: (role_id = 5)         ->  Hash  (cost=3517.81..3517.81 rows=1212 width=16) (actual time=0.955..0.955 rows=5 loops=1)               ->  Nested Loop  (cost=15.87..3517.81 rows=1212 width=16) (actual time=0.221..0.912 rows=5 loops=1)                     ->  Bitmap Heap Scan on _article  (cost=10.02..25.10 rows=5 width=40) (actual time=0.088..0.105 rows=5 loops=1)                           Recheck Cond: ((id = 69) OR (id = 32407) OR (id = 66209) OR (id = 96939) OR (id = 140396))                           ->  BitmapOr  (cost=10.02..10.02 rows=5 width=0) (actual time=0.079..0.079 rows=0 loops=1)                                 ->  Bitmap Index Scan on _article_pkey  (cost=0.00..2.00 rows=1 width=0) (actual time=0.019..0.019 rows=1 loops=1)                                       Index Cond: (id = 69)                                 ->  Bitmap Index Scan on _article_pkey  (cost=0.00..2.00 rows=1 width=0) (actual time=0.012..0.012 rows=1 loops=1)                                       Index Cond: (id = 32407)                                 ->  Bitmap Index Scan on _article_pkey  (cost=0.00..2.00 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=1)                                       Index Cond: (id = 66209)                                 ->  Bitmap Index Scan on _article_pkey  (cost=0.00..2.00 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=1)                                       Index Cond: (id = 96939)                                 ->  Bitmap Index Scan on _article_pkey  (cost=0.00..2.00 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=1)                                       Index Cond: (id = 140396)                     ->  Bitmap Heap Scan on _blog  (cost=5.85..695.52 rows=242 width=40) (actual time=0.151..0.152 rows=1 loops=5)                           Recheck Cond: ("outer".path <@ _blog.path)                           ->  Bitmap Index Scan on gist_idx_blog_path  (cost=0.00..5.85 rows=242 width=0) (actual time=0.146..0.146 rows=1 loops=5)                                 Index Cond: ("outer".path <@ _blog.path)   ->  Index Scan using idx_user_id on _user  (cost=0.00..5.01 rows=1 width=8) (actual time=0.008..0.011 rows=1 loops=5)         Index Cond: ("outer".entity_id = _user.id) Total runtime: 942.064 ms(27 rows)