now applied p_value on the mysql query - restricted index