PERF: Create a partial regular post_search_data index on large sites. (PR #10504)

GitHub

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 regular_offset_post_id

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

Even better!

@eviltrout @SamSaffron Thank you for reviewing :+1: