Skip to content
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

Deduplicate dynamic form queryset #156

Closed
wants to merge 11 commits into from

Conversation

moumoutte
Copy link
Contributor

@moumoutte moumoutte commented Jan 15, 2017

refs #155

/!\ need #154 to be merged, which actually introduce django-perf-rec into django-formidable

In master

TestDynamicForm.test_queryset_with_role:
- db: 'SELECT ... FROM "formidable_field" WHERE "formidable_field"."form_id" = # ORDER BY "formidable_field"."order" ASC'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_item" WHERE "formidable_item"."field_id" = #'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_item" WHERE "formidable_item"."field_id" = #'
- db: 'SELECT ... FROM "formidable_preset" WHERE "formidable_preset"."form_id" = #'
TestDynamicForm.test_queryset_without_role:
- db: 'SELECT ... FROM "formidable_field" WHERE "formidable_field"."form_id" = # ORDER BY "formidable_field"."order" ASC'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_item" WHERE "formidable_item"."field_id" = #'
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."field_id" = # AND "formidable_access"."access_id" = #)'
- db: 'SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" = #'
- db: 'SELECT ... FROM "formidable_item" WHERE "formidable_item"."field_id" = #'
- db: 'SELECT ... FROM "formidable_preset" WHERE "formidable_preset"."form_id" = #'

in current branch

TestDynamicForm.test_queryset_with_role:
- db: 'SELECT ... FROM "formidable_field" WHERE "formidable_field"."form_id" = # ORDER BY "formidable_field"."order" ASC'
- db: SELECT ... FROM "formidable_item" WHERE "formidable_item"."field_id" IN (...) ORDER BY "formidable_item"."order" ASC
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."access_id" = # AND "formidable_access"."field_id" IN (...))'
- db: SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" IN (...)
- db: SELECT ... FROM "formidable_default" WHERE "formidable_default"."field_id" IN (...)
- db: 'SELECT ... FROM "formidable_preset" WHERE "formidable_preset"."form_id" = #'
TestDynamicForm.test_queryset_without_role:
- db: 'SELECT ... FROM "formidable_field" WHERE "formidable_field"."form_id" = # ORDER BY "formidable_field"."order" ASC'
- db: SELECT ... FROM "formidable_item" WHERE "formidable_item"."field_id" IN (...) ORDER BY "formidable_item"."order" ASC
- db: 'SELECT ... FROM "formidable_access" WHERE ("formidable_access"."access_id" = # AND "formidable_access"."field_id" IN (...))'
- db: SELECT ... FROM "formidable_validation" WHERE "formidable_validation"."field_id" IN (...)
- db: SELECT ... FROM "formidable_default" WHERE "formidable_default"."field_id" IN (...)
- db: 'SELECT ... FROM "formidable_preset" WHERE "formidable_preset"."form_id" = #'

@brunobord
Copy link
Contributor

superseded by #162

@brunobord brunobord closed this Jan 16, 2017
brunobord added a commit that referenced this pull request Jan 17, 2017
Changelog

* Added a make target to install the demo site (#152).
* Added django-perf-rec module for tests and improved SQL queries in `ContextFormDetailView` (#54, #154, #160).
* Added test to count queries on dynamic form queryset + improve performances (#155, #156, #162).
* Added test to count queries on retrieve builder view + improve performances by removing duplicate queries (#157, #158, #163).
@brunobord brunobord mentioned this pull request Jan 17, 2017
@moumoutte moumoutte deleted the deduplicate_dynamic_form_queryset branch February 20, 2017 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants