-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to a new recorded data table #127
Comments
a float64 floatfield has only 52 bits for the number the rest is for the exponent, so only 32 bit integers can be stored, this is Okay for most values, but we have to drop INT64 and UINT64 data types. I'm not sure what would be the performance penalty for having a char or textfield as column in the DB, but i suspect for bigger queries it would be not so good. With the new option to have more than one data table/backend would it be possible to have a separate Table for variables that have to store data as str? |
Ok, so we need 3 fields:
I don't know if there is a performance penalty to have a char or text column for the variable not having data in it, I will try it. One solution with the new data source architecture could be to separate this in 3 tables:
One question is what should the manager do if the variable value class is:
|
in my opinion either drop the value and throw an error or convert to the appropriate data type |
Ok so finally all the values of a variable will be in only one table. |
The idea is to create a new recorded data table that is more simple to store numbers and boolean (one field) and allows to store strings.
I made some test about the difference using one field for boolean, integer and floats or separated fields as currently, and a field for strings.
Here is the django app used to test :
dbTest.zip
in
dbTest/models.py
you have :RecordedData
is the same as currently used in PyScadaRecordedData2
that store everything in aFloatField
RecordedData3
is asRecordedData2
with aCharField
columnRecordedData4
is the same asRecordedData3
RecordedData5
is the same as RecordedData4 but theCharField
is aTextField
in
dbTest/a.py
you have the result :RecordedData2
is quite the same asRecordedData
: slightly faster and smallerRecordedData3
is quite the same asRecordedData2
: slightly slower and largerRecordedData4
store a text and is larger thanRecordedData3
RecordedData5
is quite the same asRecordedData4
My proposition is to use the RecordedData4 or RecordedData5 as the new table.
@trombastic, what do you think ?
The text was updated successfully, but these errors were encountered: