qydlqcwsiacfymissuesapacheorg httpissuesapacheorgspamassassinshow_bugcgiid5670 summary optimize bayes sql queries product spamassassin version 321 platform osversion status new severity minor priority p5 component spamassassin assignedto xrhspamassassinapacheorg reportedby deprpuqhmeinlbnvbambergde autoexpiry bayes tokens may take time sql database huge may sometimes lead timeouts spamd process helps create additional index bayes_tokenid atime speed autoexpiry however leas one query process optimized database postgres case make use index bayessqlcalculate_expire_delta select count bayes_token id atime simple rearranging second condition select count bayes_token id atime index used autoexpiry much faster receiving mail assignee bug watching assignee tue 05 aug 2008 170700 0700 bug 5670 new optimize bayes sql queries