explain select count(distinct(b.customer_id)) as members, sum(b.total_loyalty) as sales, count(b.customer_id) as visits, c.attr_cd, c.attr_type_cd, c.description as description from sc_customer_attr a, sc_add_points b, sc_attr c where exists (select z.customer_id from (select d.customer_id, sum(d.total_loyalty) as points from sc_add_points d where d.transdate >= 19980100.000000 and d.transdate <= 20020931.000000 and d.company_cd = 1 and d.branch_cd = 13 and a.customer_id = d.customer_id group by d.customer_id order by points desc limit 100 ) as z ) and a.attr_cd = c.attr_cd and a.attr_type_cd = c.attr_type_cd and a.attr_type_cd = 2 and a.company_cd = c.company_cd and b.customer_id = a.customer_id group by c.attr_type_cd, c.attr_cd, c.description order by c.description asc LIMIT 10 OFFSET 0;