World: r3wp
[MySQL]
older newer | first last |
amacleod 29-May-2009 [1143] | Need some advice on db structure. I'm not sure which would be better for this senario: I want to store user generated data which could consist of thousands of rows. But I also will want to be able to search across each users data. I could create a seperate table for each user and join tables when searching through all user data or I could make one large database with a user field to seperate out that user's data when needed. There could be many hundred users. What is SOP in such a case? |
Sunanda 29-May-2009 [1144] | Is the users' data freeformat, or fixed fields? ie do they each have the same data fields (but with different values), or can they define whatever data they want to store? |
amacleod 29-May-2009 [1145x2] | Each table will be the exact same stucture |
I guess fixed fields | |
Sunanda 29-May-2009 [1147] | Then it'd be normal to have one large table. But (and I iguess this is your question): are there worthwhile (perhaps essential) performance improvements by denormalising? Perhaps partitioning different users on different drives or servers. Sadly, normalisation theory is silent on that subject. Can you experiment with some generated fullsize data and see? |
amacleod 29-May-2009 [1148] | No, not really... One table would be much easier and I do not think the db would get so large that I would see major performance problems. (I always underestimate the speed of these db's.) Thanks for the advice, Sunanda. |
Sunanda 29-May-2009 [1149] | One table will be much easier to manage. Two thoughts: If you use Views to create "virtual tables" for each user, then you can (fairly) easily change the underlying structure without disrupting the application too much should you need to for performance reasons. If your data does grow large, then partitioning my help performance -- ie having one table split across multiple drives according to data values (such as user name): http://dev.mysql.com/doc/refman/5.1/en/partitioning-overview.html |
amacleod 29-May-2009 [1150] | Nice, Thanks. |
amacleod 7-Jun-2009 [1151] | Is there any reason mysql will not accept a nested block in a text field? I have no problem with sqlite storing the same data... |
Janko 7-Jun-2009 [1152x3] | you mean molded nested block - text? |
no, where can I find it? | |
ups.. wrong channel | |
amacleod 7-Jun-2009 [1155] | for example: [["edfefwf" 3.4.5]["gdegerg" 4.5.6]] |
Janko 7-Jun-2009 [1156x2] | do you "mold" it? what kind of field do you try to store it in? |
maybe sqlite molds it automagically ? | |
amacleod 7-Jun-2009 [1158x2] | I've tried text and varchar |
text has no issues in sqlite | |
Janko 7-Jun-2009 [1160] | SQL command is a string so IMHO you have to mold it and enquote it as normal text and then there should be no problems .. what kind of errors does it throw? |
amacleod 7-Jun-2009 [1161x2] | I molded it and it inserted into mysql but now I need to see if after selecting it that it behaves properly in my app.... thanks for the help |
yeah, my app crashes I need to convert back to block... | |
Janko 7-Jun-2009 [1163] | yes you need to deserialize it after retrieval. |
amacleod 7-Jun-2009 [1164x2] | I'm using 'mold/only' saving to mysql and 'to-block' to re-block it... is there a cleaner way like an 'unmold'? |
Also, i have some datestamp issues. rebol attaches the zone code to now when getting the date/time but when using mysql timestamp I do not get a time zone attached and its screwing me up. Is there a way to add time zone to datestamp in mysql? | |
Janko 7-Jun-2009 [1166x2] | hm.. I think you use load to get rebol data back from string |
load "[... ]" | |
amacleod 7-Jun-2009 [1168x4] | right...duh! |
From what I have been able to read about timestamps and mysql I might as well insert the client's time... But then I would need to issure clietn's clocks are correct.... What is SOP for this situation? | |
insure | |
Quick question about computer time,,, Eastern Time is GMT-5 which my computer clock is set to... why does rebol give me time with -4:00? 7-Jun-2009/20:24:01-4:00 | |
Graham 7-Jun-2009 [1172] | daylight saving? |
amacleod 7-Jun-2009 [1173x5] | ok, but what is rebol reading to get the time? |
I just did an update to my server time and my other computer.. I used time.nist.gove for the server and time.windows.com for the other computer and they were two minutes apart | |
I tried again and they are now synced...atleast to the minute... | |
Rebol must get the zone from the computer but why is it different? | |
I know..a little off topic..moving to core | |
amacleod 4-Jul-2009 [1178x2] | Any reason why my data in a 'text' column is getting truncated at 9999 characters? I tried 'longtext' but there was no change.. I thought 'text' holds up to 4 gigs from what I read... I saw something about longtext being limited by the way a client handles packets..could this be a problem with MySQL protocol? |
I tried to insert a longer string using phpMyAdmin and it inserted fine...no truncation. I guess its mysqlprotocol.r problem. Anyone else encounter this? Any work arounds? | |
Graham 4-Jul-2009 [1180x2] | can you use any other formats? Does mysql have text blobs ? |
try wireshark to do a tcp trace to make sure all the packets are getting thru | |
Will 5-Jul-2009 [1182x2] | I have no problem inserting much bigger data to text fields using Dock's driver, thought I can't suggest anything else then wiresharking for debugging |
Maarten: is there any news about your Sphinx stuff? Reichart "promised" to release it soon, that was some time ago 8) | |
Graham 5-Jul-2009 [1184] | Will did you not try the mysql driver for sphinx?? |
Dockimbel 5-Jul-2009 [1185] | Amacleod: There's no internal limit at 10000 bytes in mysql driver (single packet default limit is 1MB). Are you using prepared statements? If not, are you sure that your data is correctly encoded? Anyway, try using TRACE mode : trace/net on. Look at the sent packets size to see if there's a truncation in the mysql driver. |
amacleod 5-Jul-2009 [1186x2] | I check it out thanks, Doc. |
I'm sending much larger blobs (image files) and it works just text is giving the problem but I'll need to look further. Thanks all. | |
Will 5-Jul-2009 [1188x5] | are you using latest 1.3beta versionof the driver? previus version may have a problem and truncate.. |
Graham: no, do you? how is your experience with it? | |
IIRC previous version had a problem with escaping correctly {'} in some circumstances, that may be a cause of truncation. | |
here is the latest http://softinnov.org/tmp/mysql-protocol-41.rgive it a try | |
from the changelog, " Fixed parsing bug with \\. Now expression like "'\\', 'wo;rd'" will be parsed correctly." | |
older newer | first last |