Closed ohaddahan closed 6 years ago
I think I read explain
wrong , need to solve some DB issues on my application.
Looking for some way to timeout specific slow queries.
Need to override
module AjaxDatatablesRails
module ORM
module ActiveRecord
def filter_records(records)
end
def sort_records(records)
end
end
end
end
Just placing them inside the datatable class doesn't seem to help.
I think I read explain wrong , need to solve some DB issues on my application.
Ok.
Just placing them inside the datatable class doesn't seem to help.
I know : https://github.com/jbox-web/ajax-datatables-rails/issues/228. I'm looking for a solution ;)
I stumbled upon some performance issues that aren't originating from the Gem but affect the performance.
The default behaviour includes two calls to
count
, before and after filtering. This can be expensive on large tables , I recommend as a minimum to explain in the documentation thatget_raw_records
should include somewhere
query to minmize full table sweeps.It seems
PostgreSQL
andrails
order
don't act as expected (at least by me). Might be related to the query planning in the Gem. It seems to runORDER BY
on the entire table andSELECT
after. While the other way around seems a lot more efficient , assuming theSELECT
will minimize the number of results dramatically.Continuing (2) , I tried overriding
filter_records
andsort_records
right under where it saysto try and play with the query planning but they don't seem to be called from the