We are making a solr query where we are giving a custom function (which is pretty complex) and sorting the results by value of that function. The time taken by the query was in the range of 200 to 400 miliseconds. After this we added
fq:{!frange l=40 u=100}$complexCustomFunction
so the whole complex query looks like
solr/select?customFunc=complexFunction(querySpecificValue1,querySpecificValue2)&sort_by=$customFunc&fq={!frange l=40 u=100}$customFunc...
After adding just this frange fq the time taken for the query has go up ten times, so it takes around 4secs