slow SQL: QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Unique (cost=159.03..159.04 rows=1 width=763) (actual time=3892.866..3892.888 rows=1 loops=1) -> Sort (cost=159.03..159.04 rows=1 width=763) (actual time=3892.864..3892.864 rows=26 loops=1) Sort Key: person.name, bugsubscription.person Sort Method: quicksort Memory: 38kB -> Nested Loop (cost=0.00..159.02 rows=1 width=763) (actual time=709.710..3892.594 rows=26 loops=1) -> Nested Loop (cost=0.00..155.07 rows=1 width=32) (actual time=709.665..3892.042 rows=26 loops=1) -> Nested Loop (cost=0.00..105.38 rows=101 width=32) (actual time=0.085..512.618 rows=158602 loops=1) -> Index Scan using teamparticipation_person_idx on teamparticipation (cost=0.00..5.01 rows=2 width=4) (actual time=0.020..0.110 rows=30 loops=1) Index Cond: (person = 1191103) -> Index Scan using bugsubscription_person_idx on bugsubscription (cost=0.00..49.76 rows=34 width=28) (actual time=0.029..14.230 rows=5287 loops=30) Index Cond: (person = teamparticipation.team) -> Index Scan using bug_pkey on bug (cost=0.00..0.48 rows=1 width=4) (actual time=0.021..0.021 rows=0 loops=158602) Index Cond: (id = bugsubscription.bug) Filter: ((id = 523896) OR (duplicateof = 523896)) -> Index Scan using person_pkey on person (cost=0.00..3.93 rows=1 width=735) (actual time=0.014..0.014 rows=1 loops=26) Index Cond: (id = bugsubscription.person) Total runtime: 3893.299 ms
slow SQL:
QUERY PLAN ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --- 03..159. 04 rows=1 width=763) (actual time=3892. 866..3892. 888 rows=1 loops=1) 03..159. 04 rows=1 width=763) (actual time=3892. 864..3892. 864 rows=26 loops=1) .person 710..3892. 594 rows=26 loops=1) 665..3892. 042 rows=26 loops=1)
-> Nested Loop (cost=0.00..105.38 rows=101 width=32) (actual time=0.085..512.618 rows=158602 loops=1)
- > Index Scan using teamparticipati on_person_ idx on teamparticipation (cost=0.00..5.01 rows=2 width=4) (actual time=0.020..0.110 rows=30 loops=1)
Index Cond: (person = 1191103)
- > Index Scan using bugsubscription _person_ idx on bugsubscription (cost=0.00..49.76 rows=34 width=28) (actual time=0.029..14.230 rows=5287 loops=30)
Index Cond: (person = teamparticipati on.team)
-> Index Scan using bug_pkey on bug (cost=0.00..0.48 rows=1 width=4) (actual time=0.021..0.021 rows=0 loops=158602)
Index Cond: (id = bugsubscription .bug)
Filter: ((id = 523896) OR (duplicateof = 523896))
Index Cond: (id = bugsubscription .person)
-------
Unique (cost=159.
-> Sort (cost=159.
Sort Key: person.name, bugsubscription
Sort Method: quicksort Memory: 38kB
-> Nested Loop (cost=0.00..159.02 rows=1 width=763) (actual time=709.
-> Nested Loop (cost=0.00..155.07 rows=1 width=32) (actual time=709.
-> Index Scan using person_pkey on person (cost=0.00..3.93 rows=1 width=735) (actual time=0.014..0.014 rows=1 loops=26)
Total runtime: 3893.299 ms