Find Jobs
Hire Freelancers

Optimize active record datatables queries -- 2

$10-30 USD

Closed
Posted over 6 years ago

$10-30 USD

Paid on delivery
Hello, I'm using this gem : [login to view URL] to generate my datatables, but queries are not optimized, for example : I have a list with evaluations, each evaluation has 50+ questions inside then in my datatables I list evaluations, but any time I filter or load list this loads all questions inside each evaluations and its very slow when I only need evaluations data I need to load only relevant data to speed up the loading times in many datatables. This is the query : def get_raw_records [login to view URL]( :evaluation => [:assignature,:level, :evaluation_type]) .references( :evaluation => [:assignature,:level,:evaluation_type] ).distinct end Instrument belongs_to Evaluation Evaluation has_many questions console shows : "."id" = $1 LIMIT 1 [["id", 959]] Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE "questions"."id" = $1 LIMIT 1 [["id", 934]] Question Load (0.3ms) SELECT "questions".* FROM "questions" WHERE "questions"."id" = $1 LIMIT 1 [["id", 950]] (1000000 times the same)... Thanks
Project ID: 15271759

About the project

3 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
3 freelancers are bidding on average $23 USD for this job
User Avatar
Hello, I can help you regarding the optimisation of that query. Let's discuss the project more. Thanks.
$25 USD in 1 day
0.0 (1 review)
0.0
0.0

About the client

Flag of CHILE
Santiago, Chile
5.0
18
Payment method verified
Member since Dec 8, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.