mrnightowl
08-07-2007, 12:22 PM
What I really meant was Field Consolidation.
I have a couple tables in my database that where poorly constructed. At the rate my site is growing it will only get slower and slower. Every time a user wants to add other users it has to index an entire table now of about 500,000 rows to see if they have added that user. What I want to do for this table is see if there is way for me to take existing data in the table and consildate it to a more managable row size. I believe the amount of rows should be in direct relation with the amount of users. Here is the table structure.
tbl_user_points
user_points_id user_login_id points_for points added_date added_ip
14704 201990106 adduser 2 2007-07-13 0
14705 201990106 adduser 1 2007-07-13 0
14706 201990106 adduser 1 2007-07-13 0
14707 201990106 adduser 1 2007-07-13 0
14708 201990106 adduser 1 2007-07-13 0
14709 201990106 adduser 1 2007-07-13 0
14710 200996995 adduser 1 2007-07-13 0
14711 200996995 adduser 1 2007-07-13 0
What I would like there to be is only 2 Fields...user_login_id which has to be there.... and points_for which would have a format of |adduser,2,2007-07-13,IP ADDY|adduser,1,2007-07-13,IP ADDY| So basically 4 fields consolidated to 1. As you can see the user_login_id repeats every time they add someone. If I have 1,500 uniques a day and they each add 50 people. Thats 75,000 new rows a day. When I don't see why I cant have the IDs of those they added to just 1 row and keep adding to that one row. So what I'm asking is there a program out there that could do this for me? Or is there some other way to do this? I have another table with same problem. But I believe i can take the data from the other table and insert it into a user_table thats already inplace. Set functions will all have to be changed and a bunch of PHP for this but I'm willing to do it. Even if it takes me 2 weeks. :) I setup a TEST site with one of my parked domains to do all the work. In the process now of migrating a copy the database to the test site.
I have a couple tables in my database that where poorly constructed. At the rate my site is growing it will only get slower and slower. Every time a user wants to add other users it has to index an entire table now of about 500,000 rows to see if they have added that user. What I want to do for this table is see if there is way for me to take existing data in the table and consildate it to a more managable row size. I believe the amount of rows should be in direct relation with the amount of users. Here is the table structure.
tbl_user_points
user_points_id user_login_id points_for points added_date added_ip
14704 201990106 adduser 2 2007-07-13 0
14705 201990106 adduser 1 2007-07-13 0
14706 201990106 adduser 1 2007-07-13 0
14707 201990106 adduser 1 2007-07-13 0
14708 201990106 adduser 1 2007-07-13 0
14709 201990106 adduser 1 2007-07-13 0
14710 200996995 adduser 1 2007-07-13 0
14711 200996995 adduser 1 2007-07-13 0
What I would like there to be is only 2 Fields...user_login_id which has to be there.... and points_for which would have a format of |adduser,2,2007-07-13,IP ADDY|adduser,1,2007-07-13,IP ADDY| So basically 4 fields consolidated to 1. As you can see the user_login_id repeats every time they add someone. If I have 1,500 uniques a day and they each add 50 people. Thats 75,000 new rows a day. When I don't see why I cant have the IDs of those they added to just 1 row and keep adding to that one row. So what I'm asking is there a program out there that could do this for me? Or is there some other way to do this? I have another table with same problem. But I believe i can take the data from the other table and insert it into a user_table thats already inplace. Set functions will all have to be changed and a bunch of PHP for this but I'm willing to do it. Even if it takes me 2 weeks. :) I setup a TEST site with one of my parked domains to do all the work. In the process now of migrating a copy the database to the test site.