                                                                                                                                                                                                       QUERY PLAN                                                                                                                                                                                                       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=3106.38..3106.44 rows=1 width=206) (actual time=74995.71..74995.73 rows=1 loops=1)
   ->  Unique  (cost=3106.38..3106.44 rows=1 width=206) (actual time=74995.70..74995.73 rows=1 loops=1)
         ->  Sort  (cost=3106.38..3106.38 rows=1 width=206) (actual time=74995.70..74995.70 rows=2 loops=1)
               Sort Key: main.priority, main.id, main.effectiveid, main.queue, main."type", main.issuestatement, main.resolution, main."owner", main.subject, main.initialpriority, main.finalpriority, main.timeestimated, main.timeworked, main.status, main.timeleft, main.told, main.starts, main.started, main.due, main.resolved, main.lastupdatedby, main.lastupdated, main.creator, main.created, main.disabled
               ->  Nested Loop  (cost=0.00..3106.37 rows=1 width=206) (actual time=45649.41..74995.14 rows=2 loops=1)
                     ->  Nested Loop  (cost=0.00..3098.56 rows=3 width=202) (actual time=60.15..74980.08 rows=557 loops=1)
                           ->  Nested Loop  (cost=0.00..3064.38 rows=1 width=194) (actual time=59.96..74945.97 rows=263 loops=1)
                                 ->  Nested Loop  (cost=0.00..3060.40 rows=1 width=186) (actual time=59.73..74915.44 rows=263 loops=1)
                                       Join Filter: (("outer".id)::text = ("inner".instance)::text)
                                       ->  Index Scan using tickets_status, tickets_status on tickets main  (cost=0.00..273.92 rows=1 width=174) (actual time=0.08..12.01 rows=263 loops=1)
                                             Index Cond: ((status = 'new'::character varying) OR (status = 'open'::character varying))
                                             Filter: ((effectiveid = id) AND ("type" = 'ticket'::character varying))
                                       ->  Seq Scan on groups groups_1  (cost=0.00..2498.82 rows=19177 width=12) (actual time=0.07..222.29 rows=21723 loops=263)
                                             Filter: (("domain" = 'RT::Ticket-Role'::character varying) AND ("type" = 'Requestor'::character varying))
                                 ->  Index Scan using principals2 on principals principals_2  (cost=0.00..3.02 rows=1 width=8) (actual time=0.07..0.07 rows=1 loops=263)
                                       Index Cond: ("outer".id = principals_2.objectid)
                                       Filter: (principaltype = 'Group'::character varying)
                           ->  Index Scan using cachedgroupmembers3 on cachedgroupmembers cachedgroupmembers_3  (cost=0.00..29.03 rows=15 width=8) (actual time=0.06..0.07 rows=2 loops=263)
                                 Index Cond: ("outer".id = cachedgroupmembers_3.groupid)
                     ->  Index Scan using users_pkey on users users_4  (cost=0.00..3.02 rows=1 width=4) (actual time=0.02..0.02 rows=0 loops=557)
                           Index Cond: ("outer".memberid = users_4.id)
                           Filter: (lower((emailaddress)::text) = 'w2kadmin@exchange.indiana.edu'::text)
 Total runtime: 74996.80 msec
(23 rows)

