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 PyScada
RecordedData2 that store everything in a FloatField
RecordedData3 is as RecordedData2 with a CharField column
RecordedData4 is the same as RecordedData3
RecordedData5 is the same as RecordedData4 but the CharField is a TextField
in dbTest/a.py you have the result :
RecordedData2 is quite the same as RecordedData : slightly faster and smaller
RecordedData3 is quite the same as RecordedData2 : slightly slower and larger
RecordedData4 store a text and is larger than RecordedData3
RecordedData5 is quite the same as RecordedData4
My proposition is to use the RecordedData4 or RecordedData5 as the new table.
@trombastic, what do you think ?
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.pyyou have :RecordedDatais the same as currently used in PyScadaRecordedData2that store everything in aFloatFieldRecordedData3is asRecordedData2with aCharFieldcolumnRecordedData4is the same asRecordedData3RecordedData5is the same as RecordedData4 but theCharFieldis aTextFieldin
dbTest/a.pyyou have the result :RecordedData2is quite the same asRecordedData: slightly faster and smallerRecordedData3is quite the same asRecordedData2: slightly slower and largerRecordedData4store a text and is larger thanRecordedData3RecordedData5is quite the same asRecordedData4My proposition is to use the RecordedData4 or RecordedData5 as the new table.
@trombastic, what do you think ?