SELECT Player.Title, Player.IdPlayer FROM Player INNER JOIN ActivePlayer ON ActivePlayer.IdPlayer = Player.IdPlayer INNER JOIN PlayerCategoryShow ON PlayerCategoryShow.IdCategory = 18 AND PlayerCategoryShow.IdPlayer = Player.IdPlayer WHERE IdLanguage = 'EN' AND Player.IdPlayer NOT IN (279) AND Player.CreditsAvailable ORDER BY RANDOM() LIMIT 8; Limit (cost=36760.49..36760.51 rows=8 width=25) (actual time=130.359..130.375 rows=8 loops=1) -> Sort (cost=36760.49..36763.90 rows=1364 width=25) (actual time=130.355..130.360 rows=8 loops=1) Sort Key: random() -> Hash Join (cost=36252.38..36689.47 rows=1364 width=25) (actual time=87.092..126.733 rows=963 loops=1) Hash Cond: ("outer".idplayer = "inner".idplayer) -> Seq Scan on activeplayer (cost=0.00..276.45 rows=19145 width=4) (actual time=0.014..20.865 rows=19163 loops=1) -> Hash (cost=36248.24..36248.24 rows=1654 width=29) (actual time=86.901..86.901 rows=1250 loops=1) -> Hash Join (cost=35685.70..36248.24 rows=1654 width=29) (actual time=58.835..84.643 rows=1250 loops=1) Hash Cond: ("outer".idplayer = "inner".idplayer) -> Bitmap Heap Scan on playercategoryshow (cost=54.96..493.96 rows=8560 width=4) (actual time=2.445..14.130 rows=8397 loops=1) Recheck Cond: (idcategory = 18) -> Bitmap Index Scan on ix_playercategoryshow (cost=0.00..54.96 rows=8560 width=0) (actual time=2.328..2.328 rows=8401 loops=1) Index Cond: (idcategory = 18) -> Hash (cost=35619.53..35619.53 rows=4484 width=25) (actual time=56.294..56.294 rows=4114 loops=1) -> Bitmap Heap Scan on player (cost=5296.33..35619.53 rows=4484 width=25) (actual time=12.943..49.075 rows=4114 loops=1) Recheck Cond: ((idlanguage)::text = 'EN'::text) Filter: ((idplayer <> 279) AND creditsavailable) -> Bitmap Index Scan on ix_player3 (cost=0.00..5296.33 rows=15809 width=0) (actual time=9.868..9.868 rows=16245 loops=1) Index Cond: ((idlanguage)::text = 'EN'::text Total runtime: 130.946 ms