| Goal | Find derived tables (views, materialized views) that are based on more than five tables and that have more than 15 columns. This view might produce "a denormalized world view" where all the data is together in one table and applications make queries based on this single view to fulfill their specific tasks. Such view does not follow the separation of concerns principle. |
|---|---|
| Notes | The query uses a fragment of a query from: https://www.cybertec-postgresql.com/en/tracking-view-dependencies-in-postgresql/. In the returned body of view/materialized view the query replaces each newline character with the line break (br) tag for the better readability in case the query result is displayed in a web browser. In the list of table columns the separator is the line break (br) tag for the better readability in case the query result is displayed in a web browser. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Medium (Medium number of false-positive results) |
| License | MIT (opens in new tab) |
| Fixing Suggestion | Replace a big view with multiple smaller views, each of which has more specific tasks. |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Categories
This query is classified under the following categories:
Derived tables
Queries of this category provide information about the derived tables (views, materialized views), which are used to implement virtual data layer.
| Name | Description |
|---|---|
| Derived tables | Queries of this category provide information about the derived tables (views, materialized views), which are used to implement virtual data layer. |
Further reading and related materials:
Rule 3 in: Delplanque, J., Etien, A., Auverlot, O., Mens, T., Anquetil, N., Ducasse, S.: CodeCritics applied to database schema: Challenges and first results. In: 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 432-436. IEEE, (2017).
Smell "God table": Sharma, T., Fragkoulis, M., Rizou, S., Bruntink, M. and Spinellis, D.: Smelly relations: measuring and understanding database schema quality. In: Proceedings of the 40th International Conference on Software Engineering: Software Engineering in Practice, pp. 55-64. ACM, (2018).
| Reference |
|---|
| https://www.cybertec-postgresql.com/en/tracking-view-dependencies-in-postgresql/ |
| https://en.wikipedia.org/wiki/Separation_of_concerns |
| Rule 3 in: Delplanque, J., Etien, A., Auverlot, O., Mens, T., Anquetil, N., Ducasse, S.: CodeCritics applied to database schema: Challenges and first results. In: 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 432-436. IEEE, (2017). |
| Smell "God table": Sharma, T., Fragkoulis, M., Rizou, S., Bruntink, M. and Spinellis, D.: Smelly relations: measuring and understanding database schema quality. In: Proceedings of the 40th International Conference on Software Engineering: Software Engineering in Practice, pp. 55-64. ACM, (2018). |