bhaviktrambadiya's avatar

Add algorithm in database query

I have one algorithm that gives me a number (the algorithm has some other table queries) And then I need to desc that value and apply pagination to it.

In this case, I have this solution I need to calculate values for all records, sort by collection, and add pagination. but in this approach, more records mean more time to calculate the value. can anyone have any solution for it? that help me to get the correct results or strategies that help me.

0 likes
2 replies
bhaviktrambadiya's avatar

log(100+$viewscount) * pow(0.7, 1+0.15*$y*(-0.015*$matchtages*0.0092))

$viewcount = from view table and $matchtages is count of the # match from user added tags and post tags list and $y is some number which is a maximum 42 and minimum 1.

Please or to participate in this conversation.