Open saiprashanth173 opened 5 years ago
Thank you for reporting this @saiprashanth173
Actually we make use of foreign keys on almost every table except in some places like the one spot by your software. The reason we are currently not having foreign keys on the attributes you are rporting is that some of those tables require to persist even if the referenced object is deleted. The database will be soon changed splitting the referenced tables in a persistent table (including eventually only the key) and child table includiing only the data to be deleted. Please advice if you have other recomendations!
We would like to inform anyhow that the data reported by your software is correct and valuable.
thank you!
Giovanni
Hi @evilaliv3 , Sorry for the late response. I am a fellow researcher from the same group as @saiprashanth173 . Thank you for taking time and responding back. Your input has been really helpful.
Another issue we detected is use of CHECK IN constraint while creating the table. We found it in the below tables.
Model | Column/s |
---|---|
Field | instance |
FieldAttr | type |
User | Role, State, Recipient |
Message | Type |
We believe a better design is to create an additional table and creating a foreign key relationship. For instance, in the case of “User” table, “role” column, it’s advisable to create a new table, “Role” which has all the roles and have a foreign key in the “User” table.
Some advantages of having a foreign key relation in place of CHECK constraint check.
One downside of having a foreign key is the overhead of performing a Join during retrieval. However, this overhead is pretty insignificant as the tables storing these values are small in size and can easily fit in the memory and the modern DBMS can optimize the join operations.
Please let us know your views on this as well.
Hi Team,
We are database researchers at the Georgia Institute of Technology. We are developing a tool which automatically detects and provides fixes for issues present in the application database schema, which affect the performance, maintainability, and extensibility of the application. In short, the tool helps the developers to come up with good database schemas for the application.
When we ran the tool through GlobaLeaks, it flagged a few issues. We wanted to validate our results with you and know if they would actually have a positive impact on the application.
One of the issues detected was missing foreign key relationships in some of the tables, you can find the details in the table below.
Some advantages of creating a foreign key relationship:
Although it is believed that foreign key constraints have an impact on the insert performance, from our experiments we realize that this is pretty insignificant opposed to the advantages it offers.
We are happy to share other issues detected by the tool and suggested improvements if you are interested. Your input will be very valuable to us to improve the tool we are developing. Looking forward to hearing from you.
Thanks for your time.