How to my stored procedure make it fast and beautiful...( select . select. select.. )
<p>I'm junior Ruby-mysql programmer and I want to know how to make my (Stored procedure )query result fast.. </p>

<p>here is my Stored procedure
and I'm using SQL_CACHE.. but I'm not sure.. the cache makes my procedure fast.. : ( </p>

<pre><code> DROP PROCEDURE IF EXISTS GET_AV //
    CREATE PROCEDURE GET_AV()
    BEGIN
        DECLARE OVERALL FLOAT ;
        DECLARE MALE FLOAT ;
        DECLARE FEMALE FLOAT ;
        DECLARE UNDER25 FLOAT ;
        DECLARE ABOVE25 FLOAT ;
        DECLARE UNDER25MALE FLOAT ;
        DECLARE UNDER25FEMALE FLOAT ;
        DECLARE ABOVE25MALE FLOAT ;
        DECLARE ABOVE25FEMALE FLOAT ;
        DECLARE CNT FLOAT;



    #AVERAGE OVERALL
    select SQL_CACHE  avg(r.frq) as AVG_OVERALL INTO OVERALL from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id;


    #AVERAGE MALE
    select SQL_CACHE  avg(r.frq) as AVG_MALE INTO MALE from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id WHERE GENDER = 1; 

    #AVERAGE FEMALE 
    select SQL_CACHE  avg(r.frq) as AVG_FEMALE INTO FEMALE from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id WHERE GENDER = 2;

    #AVERAGE UNDER25
    select SQL_CACHE  avg(r.frq) as AVG_UNDER_25 INTO UNDER25  from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id where AGE &lt;= 25; 

    #AVERAGE ABOVE25
    select  avg(r.frq) as AVG_ABOVE_25 INTO ABOVE25 from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id where AGE &gt;= 25; 


    #AVERAGE UNDER 25 &amp; MALE
    select SQL_CACHE  avg(r.frq) as AVG_UNDER_25_MALE INTO UNDER25MALE from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id WHERE AGE &lt;= 25 AND GENDER = 1; 

    #AVERAGE UNDER 25 &amp; FEMALE
    select SQL_CACHE  avg(r.frq) as AVG_UNDER_25_FEMALE INTO UNDER25FEMALE from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id WHERE AGE &lt;= 25 AND GENDER = 2; 

    #AVERAGE ABOVE25 &amp; MALE
    select SQL_CACHE  avg(r.frq) as AVG_ABOVE_25_MALE INTO ABOVE25MALE from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id where AGE &gt;=25 AND GENDER = 1; 

    #AVERAGE ABOVE25 &amp; FEMALE
    select SQL_CACHE  avg(r.frq) as AVG_ABOVE_25_FEMALE INTO ABOVE25FEMALE from tbl_survey as s inner join tbl_respondent as r on s.s_id = r.s_id WHERE AGE &gt;= 25 AND GENDER = 2;







    SELECT OVERALL,MALE,FEMALE,UNDER25 ,ABOVE25 , UNDER25MALE,UNDER25FEMALE ,
    ABOVE25MALE ,ABOVE25FEMALE;


    END //
</code></pre>

<p>luckily its not too slow now.. 
but I want to know how to make it more and more fast and beautiful code way :( </p>