[AMaViS-user] sql_select_policy optimization question

This is a discussion on [AMaViS-user] sql_select_policy optimization question within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; While looking at ways to better handle policy selection for users, from a GUI standpoint, I was also experimenting with ...


Go Back   Usenet Forums > Anti-Spam and Anti-Virus Related Forums > Amavis User

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2007
Michael Scheidell
 
Posts: n/a
Default [AMaViS-user] sql_select_policy optimization question

While looking at ways to better handle policy selection for users, from
a GUI standpoint, I was also experimenting with sql_select_policy's

(I could never get it to work the way I wanted to, but)

During testing, I was adding 'limit 1' to query.

Does that help? With my background in real-time, embedded systems, I
can't help to think that it would have to.

Example: default from amavisd.conf-default:

$sql_select_policy =
'SELECT *,users.id'.
' FROM users LEFT JOIN policy ON users.policy_id=policy.id'.
' WHERE users.email IN (%k) ORDER BY users.priority DESC';

Adding limit 1:

sql_select_policy =
'SELECT *,users.id'.
' FROM users LEFT JOIN policy ON users.policy_id=policy.id'.
' WHERE users.email IN (%k) ORDER BY users.priority DESC limit 1';


If there were four or more policies available (@. @domain.com user
user@domain.com).

It will sort first, and instead of sending back 4 policies (which
amavisd-new only takes the first one anyway), why not just limit it to
the first one in the sort order anyway?

Maybe this isn't THAT much of a change, but in a situation where you
have 70,000 users in the users table, and 70,000 policies, might it not
help?

--
Michael Scheidell, CTO
SECNAP Network Security Corporation
See us in Atlanta at SecureWorld:
http://www.secnap.com/events
__________________________________________________ ______________________
_
This email has been scanned and certified safe by SpammerTrap(tm).
For Information please see http://www.spammertrap.com
__________________________________________________ ______________________
_
__________________________________________________ _______________________
This email has been scanned and certified safe by SpammerTrap(tm).
For Information please see http://www.spammertrap.com
__________________________________________________ _______________________

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?p...rge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/...fo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:12 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0