Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 883987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:41:00+00:00 2026-05-15T12:41:00+00:00

If I have an event/function that requires changing a lot of different variables in

  • 0

If I have an event/function that requires changing a lot of different variables in my Active Record, should I directly access them and change them all at once from my library or have the library do multiple model calls?

The data I want to change is spread over a handful of different mysql tables but some are within the same table.

I’m concerned that doing the multiple model calls will hurt performance but doing the alternative will probably break modularity and prevent reusability.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:41:01+00:00Added an answer on May 15, 2026 at 12:41 pm

    For me, each model represents one table anyway. (I think most people do it this way) If the data needs to be changed in multiple tables, I have to make calls to multiple models.

    I think it’s better to use the models the way they’re intended (rather than not at all). When I first used codeigniter, I didn’t use them because I thought active record (or at least codeigniter’s implementation of it) made it so easy to work with the database. Once I realized how models can be used I never looked back.

    I also might add that this really depends on the size of the application. Maybe there’s not a lot of tables and you need the highest performance; it might be completely fine to do it with calls to active record from your controller.

    In the end, I think re-usability and maintainability are most important.

    You might also be able to use your models to build up the queries and not execute them, and then execute them altogether (is that where you’re thinking you would lose performance?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that is triggered by the onkeydown event of a textbox.
I have a deferred function that binds a mouseenter event: $(window).load(function(e) { var $container
I have more than one Event Listener that calls a specific function, and I
I have a function that archives an event log to a file in a
I have a function that adds change events for form items based on the
I have a function that adds eventhandlers to control events. Right now I have
I have a table that functions as an event log and stores the users
Input rz value In the head I have: Event.observe(window, 'load', function() { $$(input).each(function(field){ Event.observe(field,
I have an onbeforeunload event : $().ready(function() { window.onbeforeunload=function() { return haha }; });
I have this: function test() { this.method = function () { $(html).mousemove(function(event) { console.log('~>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.