WIP: optimization on displaying studies list

I got really tired of how slow is the studies display when having so many studies so I started working on https://github.com/biocore/qiita/issues/601. This is the initial optimization of /private/. I want to have some feedback before working on the others. 
What about making this a procedure?

On (Nov-24-14| 7:42), Antonio Gonzalez wrote:
> > +            "qiita.study_users.study_id = qiita.study.study_id)), ',') AS "
> > +            "shared_with, count(raw_data_id), (SELECT qiita.study_person.name "
> > +            "|| '&' || qiita.study_person.email FROM qiita.study_person WHERE "
> > +            "qiita.study_person.study_person_id = "
> > +            "qiita.study.principal_investigator_id) AS pi, array_to_string("
> > +            "array(SELECT qiita.study_pmid.pmid FROM qiita.study_pmid WHERE "
> > +            "qiita.study_pmid.study_id = qiita.study.study_id), ',') AS "
> > +            "pmid, (SELECT qiita.qiita_user.name || '&' || "
> > +            "qiita.qiita_user.email FROM qiita.qiita_user WHERE "
> > +            "qiita.qiita_user.email = qiita.study.email), (SELECT "
> > +            "qiita.study_status.status FROM qiita.study_status WHERE "
> > +            "qiita.study_status.study_status_id = "
> > +            "qiita.study.study_status_id) FROM qiita.study LEFT JOIN "
> > +            "qiita.study_raw_data ON qiita.study.study_id = "
> > +            "qiita.study_raw_data.study_id WHERE email = %s GROUP BY "
> > +            "qiita.study.study_id ORDER BY qiita.study.study_id")
> 
> Let's discuss before changing, not sure how to make it _more_ human
> readable.
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/biocore/qiita/pull/679/files#r20797392