I recommend always calling
to_i with SQL string interpolation of numbers. If someone could change that site setting to a string they could inject SQL.
This function is only ever called once with
false as the value so why make it a parameter?
In this case you are doing DB.exec … so
DB.exec(<<~SQL, post_id: SiteSetting.....) will do the trick
agree… lest just call it
let’s not call the index “temp” it is strictly temporary … but it is always there… people may thing they created it by accident…
idx_recent_regular_post_search_data is a good name