: What method should I use for copying data from one table to another one? I'm wondering what method I should use for copying data from one table to another one. I'm letting users post data
I'm wondering what method I should use for copying data from one table to another one. I'm letting users post data through a form which uses table1 to save data. Now for displaying results I use data from table2 but I also need some data from table1.
Method 1: Copy the needed data on pageload, when the user executes it. Might get slower, but uses live data.
Method 2: Use a cronjob. Less resources, but not live data
I'm interested in how much this will affect the speed of the website.
More posts by @Kaufman445
1 Comments
Sorted by latest first Latest Oldest Best
Depends on the amount of data.
If:
No large/weird/complex queries
No large datasets
Rowlocking (innoDB) instead of tablelocking (MyISAM)
No absurt amount of users/pagehits
Then you have no problem at all. Just make sure you index the right columns, and cleanup what you can so you dont get redundent data. If you're not sure when you should consider something 'a large dataset', you're not using a large dataset.
Easy answer: Just try and you'll see :).
But to my experience, the most influention factor is the queries themselves, just make sure those are right.
If you are talking about duplicating data, then please stop doing that! You can select info from two tables without ANY problem. Just use two queries, or a join.
Duplicate data is a big no-no in databases. 1 small column might provide a handy solution sometime, but always try the best you can to avoid it. This is a part of database normalisation.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.