Re: sql optimizing assistance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: <jeffrey_n_Dyke@Keane.com>


> I have two tables and am running a simple join between them to get
> questions and their repsective response averages from a survey.  The
> question table has 49 rows and the Response table has 126,732.  I'd like
to
> cut down on the time its taking to run this specific query...as i'll be
> running many like it to generate reports. The query below is the selecting
> the most data, normally this will be limited to specific groups by joining
> more tables.
>
> I am executing the following query
> SELECT Question.Text_Long, AVG( Response ) FROM `Response` INNER JOIN
> Question ON Question.Question_Key = Response.Question_Key WHERE
> Question.Question_Key LIKE '2003%' GROUP BY Response.Question_Key ORDER BY
> Question.Question_Key ASC

What does EXPLAIN tell you for this query? Is it using your indexes?

---John Holmes...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux