[prev in list] [next in list] [prev in thread] [next in thread] 

List:       amavis-user
Subject:    [AMaViS-user] default sql_policy query doesn't use all keys?
From:       Michael Scheidell <scheidell () secnap ! net>
Date:       2007-04-24 21:01:20
Message-ID: 462E7020.1020908 () secnap ! net
[Download RAW message or body]

Looking at optimizations for sql queries in amavisd-new,  default 
sql_policy can't find enough key material to use? or is this impossible 
due to the IN statement?

even the default query uses 'filesort'.

is it the IN statement?

mysql> explain select *,users.id from users left join policy on 
users.policy_id=policy.id where users.email in ('scheidell', 
'scheidell@domain.com', '@.') order by users.priority desc;
+----+-------------+--------+--------+---------------+---------+---------+----------------------+------+-----------------------------+
 | id | select_type | table  | type   | possible_keys | key     | key_len 
> ref                  | rows | Extra                       |
+----+-------------+--------+--------+---------------+---------+---------+----------------------+------+-----------------------------+
 |  1 | SIMPLE      | users  | range  | email_2,email | email_2 | 257     
> NULL                 |    3 | Using where; Using filesort |
> 1 | SIMPLE      | policy | eq_ref | PRIMARY,id    | PRIMARY | 4       
> mail.users.policy_id |    1 |                             |
+----+-------------+--------+--------+---------------+---------+---------+----------------------+------+-----------------------------+




_________________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(tm). 
For Information please see http://www.spammertrap.com
_________________________________________________________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic