4 months ago

Reduce the number of database round trips

Posted 4 months ago by Joeraid


I'm trying to optimize a web service that I'm working on. I've already batched together selects, inserts and updates per table but the number of tables is just too large and is noticeably impacting the performance (8+ seconds response time at best), so I was looking to bundle together all my queries and send them in a single network request akin to what mysqli::multi_query supposedly does but using Laravel's API for code consistency. Is this possible? I've also tried to find a way to generate update and insert statements without executing them in hopes of appending all the resulting raw strings and then sending that, Can I do something like this in Laravel?

Please sign in or create an account to participate in this conversation.