QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sort (cost=1976276.28..1976278.95 rows=1066 width=48) (actual time=15534.487..15534.905 rows=1955 loops=1) Sort Key: e.update_date, e.id Sort Method: quicksort Memory: 266kB -> Nested Loop (cost=1969508.56..1976222.68 rows=1066 width=48) (actual time=15468.878..15531.632 rows=1955 loops=1) -> HashAggregate (cost=1969508.56..1969519.22 rows=1066 width=7) (actual time=15466.945..15468.128 rows=1955 loops=1) -> Nested Loop (cost=111.20..1743217.16 rows=90516558 width=7) (actual time=1.302..15147.554 rows=290348 loops=1) -> HashAggregate (cost=111.20..111.69 rows=49 width=10) (actual time=1.216..3.309 rows=641 loops=1) -> Bitmap Heap Scan on rhnuserserverperms usp (cost=32.66..109.78 rows=569 width=10) (actual time=0.315..0.864 rows=641 loops=1) Recheck Cond: (user_id = 13::numeric) -> Bitmap Index Scan on rhn_usperms_uid_sid_uq (cost=0.00..32.52 rows=569 width=0) (actual time=0.299..0.299 rows=641 loops=1) Index Cond: (user_id = 13::numeric) -> Index Scan using rhn_snc_speid_idx on rhnserverneededcache snec (cost=0.00..25097.13 rows=838116 width=18) (actual time=0.225..23.329 rows=453 loops=641) Index Cond: (snec.server_id = usp.server_id) Filter: (snec.errata_id IS NOT NULL) -> Index Scan using rhn_errata_id_pk on rhnerrata e (cost=0.00..6.27 rows=1 width=48) (actual time=0.024..0.031 rows=1 loops=1955) Index Cond: (e.id = snec.errata_id) Total runtime: 15535.489 ms (17 rows)