kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tag:
Branch:
Tree:
d632ba6bb6
12-3-1-notes-fixes
45001-component-to-show-the-list-of-non-working-days-of-year
45827-project-list-dropdown-actions-cut-off
Small-docs-fix
bug-process-documentation
bug/36827-creating-work-package-in-status-not-available-for-work-package-type
bug/41714-clicking-on-files-tab-scrolls-up-on-ios
bug/41851-blank-email-reminders-page-when-creating-account-manually
bug/43193-remove-oauth-cookie-after-successful-authorization-against-nextcloud
bug/43323-nextcloud-validation-error-in-new-storage-host-field
bug/43504-date-picker-not-working-as-expected-for-utc-time-hour-minus
bug/44924-error-in-souce-string-for-team-planner
bump/angular13
chore/file-list-padding-overwrite
chore/fix-error-toast-for-broken-oauth-data
chore/restructure-file-list-style
code-maintenance/45463-apply-rails-5-0-defaults
dev
display-skeleton-view-over-team-planner-calendar
docker-install
docs-add-details-follow-precede-gantt-distance
docs-add-details-follow-precede-gantt-distance-2
docs-update-to-notifications
docs-updates
docs-updates-for-12.5
documentation/design-system
feat/design-system
featuer/26688/in-app-notifications-table-change
feature/26688/ian-announcements
feature/37398-select-input-none-option
feature/37441-dynamic-form-v2
feature/40228-openapi-spec
feature/40228-openapi-specification-part-2
feature/41530-copying-a-project-shall-also-copy-file-links-attached-to-all-work-packages
feature/42358-standardise-date-pickers
feature/42358-standardise-date-pickers-2
feature/42358-standardise-date-pickers-drop-modal-portal
feature/43118-access-project-dropdown-entries-via-arrow-keys
feature/43638-update-team-planner-and-calendar-for-duration-and-non-working-days-rebased
feature/43644-revoke-access-to-storage-granted-by-oauth
feature/44212-new-release-teaser-block-for-123
feature/45963-remove-select-all-and-open-storage-interaction-elements-from-file-pickers
feature/api_v3_activities_index
feature/documenting-services-and-contracts
feature/ee-date-alerts
feature/file-links-oauth-connection-manager-rebased
feature/in-app-notifications-settings
feature/invite-user-modal
feature/notification_signaling
feature/openapi-spec-and-swagger-ui
feature/placeholder-users
feature/settings_api
feature/spot-list-tooltip-rework
feature/team-planner-fullcalendar
feature/translations-hierarchy
fix-column-width-including-ngselect
fix-tab-info-not-updated-in-notification-center
fix/34436-edit-backlog-date-focus-backlog-details
fix/34436-edit-backlog-date-focus-backlog-details-firefox-quirk
fix/35563-hide-boards-user-is-not-allowed
fix/36521-Saving-changes-to-user-profile-after-handling-error-message-leads-to-user-profile
fix/37509/modal-position-relative
fix/39123-mobile-tab-overflow
fix/39833-work-package-parent-shrink
fix/41437-project-selector
fix/41535-datepicker-overflow
fix/42397-project-filter-is-not-applied-in-embedded-table
fix/43085/default-cf-value-filter
fix/43230-toggle-disabled-state-not-defined
fix/43259-the-list-style-in-the-nextcloud-section-is-not-correct
fix/44197-sort-workpackages-by-updated-at
fix/44846-custom-field-multi-select
fix/45586/totp-clock-error-discoverability
fix/activity-change-detection
fix/activity-tab-spec
fix/api-spec-storage-files
fix/attachments-drag-n-drop-chrome
fix/comment-number-cut-off-on-moblie
fix/custom-plugin-frozen
fix/improve_scheduling_performance-with-simpler_sql
fix/inline-wp-button-macro
fix/json_serialize_delayed_job
fix/missing-omniauth-strategy
fix/notification_and_wp_visiblity_check_performance
fix/op-sidemenu-href
fix/op-sidemenu-onpush
fix/rails_7_scope_merging_on_index
fix/re-enable-rake-task
fix/reject-invalid-host-headers
fix/remove-differential-building
fix/run-url-github
fix/selector_for_board_specs
fix/storybook-zone-aware-promise
fix/update_robot_txt
fix/whitelist_date_on_config_yaml_load
fix/wysiwyg-changes_wo_ckeditor
hal_presenter_demo
housekeeping/update-rxjs
implementation-wp-quick-add-modal-component
implementation/42204-add-file-links-collection-to-work-package-resource
implementation/42379-add-endpoint-to-update-cache-with-live-data
implementation/42843-add-authorization-state-to-storages-api-endpoint
implementation/43693-add-file-link-list-component-to-new-work-package-form
implementation/45083-update-look-of-activity-items-in-activity-module-for-project-and-work-packages
integration/outdated_10.5
packaging/sles15
refactor/autocompleters
refactor/hal-resource-2
refactor/handle-prettier-dependency
release/11.2
release/11.3
release/11.4
release/12.0
release/12.1
release/12.2
release/12.3
release/12.4
revert-10203-fix/ldap-sync-mutex
revert-9332-feature/37472-dynamic-forms-v2-flat-resources_links-model
spike/fullcalendar-resources
spike/hotwire
spike/try-removing-shoulda
stable/10
stable/11
stable/12
stable/5
stable/6
stable/7
stable/8
stable/9
task/41010-add-configure-work-packages-forms-(headlines)-(premium-feature)
task/42684-project-settings-change-screenshot-and-customize-text
task/42759-new-wording-for-note-in-the-english-user-guide
task/43309-edit-forum-section-in-user-guide
task/43662-edit-work-package-faq
task/44235-user-guide-notification-typo-fix
task/44256-user-guide-calculate-work-package-progress-with-work-package-status
update-style-guide-screenshots
wizard-test
11.2.1
2.4.0
release/3.0.0
sprint/2014_08
sprint/2014_09
sprint/2014_10
sprint/2014_11
sprint/2014_12
sprint/2014_13
sprint/2014_16
sprint/2014_18
sprint/2015_01
sprint/2015_02
sprint/2015_03
sprint/2015_04
v10.0.0
v10.0.1
v10.0.2
v10.1.0
v10.2.0
v10.2.1
v10.2.2
v10.3.0
v10.3.1
v10.4.0
v10.4.1
v10.5
v10.5.0
v10.5.1
v10.6.0
v10.6.1
v10.6.2
v10.6.3
v10.6.4
v10.6.5
v11.0.0
v11.0.1
v11.0.2
v11.0.3
v11.0.4
v11.1.0
v11.1.1
v11.1.2
v11.1.3
v11.1.4
v11.2.0
v11.2.1
v11.2.2
v11.2.3
v11.2.4
v11.3.0
v11.3.1
v11.3.2
v11.3.3
v11.3.4
v11.3.5
v11.4.0
v11.4.1
v12.0.0
v12.0.1
v12.0.10
v12.0.2
v12.0.3
v12.0.4
v12.0.5
v12.0.6
v12.0.7
v12.0.8
v12.0.9
v12.1.0
v12.1.1
v12.1.2
v12.1.3
v12.1.4
v12.1.5
v12.1.6
v12.2.0
v12.2.1
v12.2.2
v12.2.3
v12.2.4
v12.2.5
v12.3.0
v12.3.1
v12.3.2
v12.3.3
v12.3.4
v12.4.0
v12.4.1
v12.4.2
v12.4.3
v3.0.0
v3.0.1
v3.0.11
v3.0.12
v3.0.13
v3.0.14
v3.0.15
v3.0.16
v3.0.17
v3.0.2
v3.0.3
v3.0.4
v3.0.8
v4.0.0
v4.0.1
v4.0.10
v4.0.11
v4.0.12
v4.0.2
v4.0.3
v4.0.4
v4.0.5
v4.0.6
v4.0.7
v4.0.8
v4.0.9
v4.1.0
v4.1.0-beta
v4.1.1
v4.1.2
v4.1.3
v4.1.4
v4.2.0
v4.2.1
v4.2.2
v4.2.3
v4.2.4
v4.2.5
v4.2.6
v4.2.7
v4.2.8
v4.2.9
v5.0.0
v5.0.1
v5.0.10
v5.0.11
v5.0.12
v5.0.13
v5.0.14
v5.0.15
v5.0.16
v5.0.17
v5.0.18
v5.0.19
v5.0.2
v5.0.20
v5.0.3
v5.0.4
v5.0.5
v5.0.6
v5.0.7
v5.0.8
v5.0.9
v6.0.0
v6.0.1
v6.0.2
v6.0.3
v6.0.4
v6.0.5
v6.1.0
v6.1.1
v6.1.2
v6.1.3
v6.1.4
v6.1.5
v7.0.0
v7.0.1
v7.0.2
v7.0.3
v7.1.0
v7.2.0
v7.2.1
v7.2.2
v7.2.3
v7.3.0
v7.3.1
v7.3.2
v7.4.0
v7.4.1
v7.4.2
v7.4.3
v7.4.4
v7.4.5
v7.4.6
v7.4.7
v8.0.0
v8.0.1
v8.0.2
v8.1.0
v8.2.0
v8.2.1
v8.3.0
v8.3.1
v8.3.2
v8.3.3-pre
v9.0.0
v9.0.0-pre
v9.0.1
v9.0.2
v9.0.2-pre
v9.0.3
v9.0.4
${ noResults }
ulferts
3bf706b153
In case e.g. Projects are to be fetched via `Project.allowed_to?` rails will add the necessary distinct to the SQL statment on its own. But having the distinct forced in the query can lead to nonperformant subqueries and there, the distinct isn't necessary at all if the subquery is something like `where(project_id: Project.allowed(...))`. In such a case, whether the values are distinct will yield the same results. But the DB's query planner will take the distinct into account and the DB will have to work extra to remove the duplicates. In case of one query at least that extra work leads to an undesirable execution time of 8s compared to 60ms when avoiding the distinct. The executions plan with distinct is like this: ``` app=> EXPLAIN ANALYZE SELECT COUNT(*) FROM "notifications" WHERE "notifications"."read_ian" IS NOT NULL AND "notifications"."recipient_id" = 2147 AND "notifications"."resource_type" = 'WorkPackage' AND "notifications"."resource_id" IN (SELECT "work_packages"."id" FROM "work_packages" WHERE "work_packages"."project_id" IN (SELECT DISTINCT "projects"."id" FROM "projects" LEFT OUTER JOIN "members" ON "projects"."id" = "members"."project_id" AND "members"."user_id" = 2148 AND "projects"."active" = TRUE INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('work_package_tracking') AND "projects"."active" = TRUE INNER JOIN "role_permissions" ON "role_permissions"."permission" IN ('view_work_packages') INNER JOIN "roles" "permission_roles" ON "permission_roles"."id" = "role_permissions"."role_id" LEFT OUTER JOIN "member_roles" ON "members"."id" = "member_roles"."member_id" LEFT OUTER JOIN "roles" "assigned_roles" ON "assigned_roles"."id" = "permission_roles"."id" AND "projects"."active" = TRUE AND ("assigned_roles"."id" = "member_roles"."role_id" OR "projects"."public" = TRUE AND "assigned_roles"."builtin" = 1 AND "member_roles"."id" IS NULL) WHERE "assigned_roles"."id" IS NOT NULL)) AND (notifications.read_ian IN ('f')); QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize Aggregate (cost=5060.65..5060.66 rows=1 width=8) (actual time=8060.041..8060.656 rows=1 loops=1) -> Gather (cost=5060.54..5060.65 rows=1 width=8) (actual time=8060.027..8060.652 rows=2 loops=1) Workers Planned: 1 Workers Launched: 1 -> Partial Aggregate (cost=4060.54..4060.55 rows=1 width=8) (actual time=8056.347..8056.357 rows=1 loops=2) -> Nested Loop Semi Join (cost=550.02..4059.44 rows=440 width=0) (actual time=83.255..8056.276 rows=62 loops=2) -> Parallel Bitmap Heap Scan on notifications (cost=103.77..1757.13 rows=1648 width=8) (actual time=0.461..7.019 rows=1826 loops=2) Recheck Cond: (recipient_id = 2147) Filter: ((read_ian IS NOT NULL) AND (NOT read_ian) AND ((resource_type)::text = 'WorkPackage'::text)) Heap Blocks: exact=523 -> Bitmap Index Scan on index_notifications_on_recipient_id (cost=0.00..103.07 rows=3554 width=0) (actual time=0.684..0.684 rows=3686 loops=1) Index Cond: (recipient_id = 2147) -> Hash Join (cost=446.24..447.36 rows=1 width=4) (actual time=4.398..4.398 rows=0 loops=3652) Hash Cond: (projects.id = work_packages.project_id) -> Unique (cost=441.49..441.78 rows=59 width=4) (actual time=4.357..4.373 rows=62 loops=3652) -> Sort (cost=441.49..441.64 rows=59 width=4) (actual time=4.357..4.362 rows=63 loops=3652) Sort Key: projects.id Sort Method: quicksort Memory: 28kB Worker 0: Sort Method: quicksort Memory: 28kB -> Merge Join (cost=159.35..439.75 rows=59 width=4) (actual time=0.499..4.343 rows=64 loops=3652) Merge Cond: (role_permissions.role_id = permission_roles.id) -> Nested Loop (cost=159.12..559.28 rows=89 width=12) (actual time=0.493..4.320 rows=64 loops=3652) Join Filter: ((assigned_roles.id = member_roles.role_id) OR (projects.public AND (assigned_roles.builtin = 1) AND (member_roles.id IS NULL))) Rows Removed by Join Filter: 21166 -> Merge Join (cost=82.31..84.06 rows=79 width=12) (actual time=0.419..0.491 rows=110 loops=3652) Merge Cond: (role_permissions.role_id = assigned_roles.id) -> Sort (cost=74.32..74.62 rows=120 width=4) (actual time=0.369..0.380 rows=120 loops=3652) Sort Key: role_permissions.role_id Sort Method: quicksort Memory: 30kB Worker 0: Sort Method: quicksort Memory: 30kB -> Seq Scan on role_permissions (cost=0.00..70.18 rows=120 width=4) (actual time=0.006..0.345 rows=121 loops=3652) Filter: ((permission)::text = 'view_work_packages'::text) Rows Removed by Filter: 3104 -> Sort (cost=7.98..8.27 rows=113 width=8) (actual time=0.048..0.057 rows=116 loops=3652) Sort Key: assigned_roles.id Sort Method: quicksort Memory: 30kB Worker 0: Sort Method: quicksort Memory: 30kB -> Seq Scan on roles assigned_roles (cost=0.00..4.13 rows=113 width=8) (actual time=0.004..0.027 rows=116 loops=3652) Filter: (id IS NOT NULL) -> Materialize (cost=76.81..299.96 rows=127 width=13) (actual time=0.000..0.013 rows=193 loops=401720) -> Hash Right Join (cost=76.81..299.32 rows=127 width=13) (actual time=0.622..0.946 rows=193 loops=2) Hash Cond: (members.project_id = projects.id) Join Filter: projects.active -> Nested Loop Left Join (cost=4.73..227.08 rows=25 width=12) (actual time=0.045..0.314 rows=68 loops=2) -> Bitmap Heap Scan on members (cost=4.44..69.05 rows=19 width=8) (actual time=0.028..0.060 rows=67 loops=2) Recheck Cond: (user_id = 2148) Heap Blocks: exact=12 -> Bitmap Index Scan on index_members_on_user_id_and_project_id (cost=0.00..4.43 rows=19 width=0) (actual time=0.019..0.020 rows=67 loops=2) Index Cond: (user_id = 2148) -> Index Scan using index_member_roles_on_member_id on member_roles (cost=0.29..8.31 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=134) Index Cond: (member_id = members.id) -> Hash (cost=70.89..70.89 rows=96 width=6) (actual time=0.558..0.562 rows=192 loops=2) Buckets: 1024 Batches: 1 Memory Usage: 16kB -> Hash Join (cost=53.25..70.89 rows=96 width=6) (actual time=0.296..0.510 rows=192 loops=2) Hash Cond: (enabled_modules.project_id = projects.id) -> Bitmap Heap Scan on enabled_modules (cost=15.16..31.81 rows=372 width=4) (actual time=0.064..0.184 rows=382 loops=2) Recheck Cond: ((name)::text = 'work_package_tracking'::text) Heap Blocks: exact=12 -> Bitmap Index Scan on index_enabled_modules_on_name (cost=0.00..15.07 rows=372 width=0) (actual time=0.054..0.055 rows=383 loops=2) Index Cond: ((name)::text = 'work_package_tracking'::text) -> Hash (cost=36.85..36.85 rows=99 width=6) (actual time=0.216..0.216 rows=195 loops=2) Buckets: 1024 Batches: 1 Memory Usage: 16kB -> Seq Scan on projects (cost=0.00..36.85 rows=99 width=6) (actual time=0.007..0.165 rows=195 loops=2) Filter: (active AND active) Rows Removed by Filter: 190 -> Index Only Scan using roles_pkey on roles permission_roles (cost=0.14..9.84 rows=113 width=4) (actual time=0.005..0.010 rows=33 loops=3652) Heap Fetches: 10956 -> Hash (cost=4.74..4.74 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=3652) Buckets: 1024 Batches: 1 Memory Usage: 9kB -> Index Scan using work_packages_pkey on work_packages (cost=0.42..4.74 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=3652) Index Cond: (id = notifications.resource_id) Planning Time: 2.242 ms Execution Time: 8060.808 ms ``` and without it: ``` EXPLAIN ANALYZE SELECT COUNT(*) FROM "notifications" WHERE "notifications"."read_ian" IS NOT NULL AND "notifications"."recipient_id" = 2147 AND "notifications"."resource_type" = 'WorkPackage' AND "notifications"."resource_id" IN (SELECT "work_packages"."id" FROM "work_packages" WHERE "work_packages"."project_id" IN (SELECT "projects"."id" FROM "projects" LEFT OUTER JOIN "members" ON "projects"."id" = "members"."project_id" AND "members"."user_id" = 2148 AND "projects"."active" = TRUE INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('work_package_tracking') AND "projects"."active" = TRUE INNER JOIN "role_permissions" ON "role_permissions"."permission" IN ('view_work_packages') INNER JOIN "roles" "permission_roles" ON "permission_roles"."id" = "role_permissions"."role_id" LEFT OUTER JOIN "member_roles" ON "members"."id" = "member_roles"."member_id" LEFT OUTER JOIN "roles" "assigned_roles" ON "assigned_roles"."id" = "permission_roles"."id" AND "projects"."active" = TRUE AND ("assigned_roles"."id" = "member_roles"."role_id" OR "projects"."public" = TRUE AND "assigned_roles"."builtin" = 1 AND "member_roles"."id" IS NULL) WHERE "assigned_roles"."id" IS NOT NULL)) AND (notifications.read_ian IN ('f')); QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize Aggregate (cost=13644.10..13644.11 rows=1 width=8) (actual time=60.167..61.846 rows=1 loops=1) -> Gather (cost=13643.99..13644.10 rows=1 width=8) (actual time=60.154..61.839 rows=2 loops=1) Workers Planned: 1 Workers Launched: 1 -> Partial Aggregate (cost=12643.99..12644.00 rows=1 width=8) (actual time=56.361..56.376 rows=1 loops=2) -> Parallel Hash Semi Join (cost=10982.86..12643.36 rows=252 width=0) (actual time=53.275..56.364 rows=62 loops=2) Hash Cond: (notifications.resource_id = work_packages.id) -> Parallel Bitmap Heap Scan on notifications (cost=103.77..1757.13 rows=1648 width=8) (actual time=0.471..3.217 rows=1826 loops=2) Recheck Cond: (recipient_id = 2147) Filter: ((read_ian IS NOT NULL) AND (NOT read_ian) AND ((resource_type)::text = 'WorkPackage'::text)) Heap Blocks: exact=196 -> Bitmap Index Scan on index_notifications_on_recipient_id (cost=0.00..103.07 rows=3554 width=0) (actual time=0.712..0.712 rows=3686 loops=1) Index Cond: (recipient_id = 2147) -> Parallel Hash (cost=10782.56..10782.56 rows=7722 width=4) (actual time=50.813..50.826 rows=2328 loops=2) Buckets: 32768 Batches: 1 Memory Usage: 480kB -> Hash Semi Join (cost=440.49..10782.56 rows=7722 width=4) (actual time=9.231..49.907 rows=2328 loops=2) Hash Cond: (work_packages.project_id = projects.id) -> Parallel Seq Scan on work_packages (cost=0.00..10123.89 rows=50389 width=8) (actual time=0.006..16.405 rows=60496 loops=2) -> Hash (cost=439.75..439.75 rows=59 width=8) (actual time=9.196..9.208 rows=64 loops=2) Buckets: 1024 Batches: 1 Memory Usage: 11kB -> Merge Join (cost=159.35..439.75 rows=59 width=8) (actual time=2.212..9.188 rows=64 loops=2) Merge Cond: (role_permissions.role_id = permission_roles.id) -> Nested Loop (cost=159.12..559.28 rows=89 width=16) (actual time=2.185..9.141 rows=64 loops=2) Join Filter: ((assigned_roles.id = member_roles.role_id) OR (projects.public AND (assigned_roles.builtin = 1) AND (member_roles.id IS NULL))) Rows Removed by Join Filter: 21166 -> Merge Join (cost=82.31..84.06 rows=79 width=12) (actual time=1.272..1.360 rows=110 loops=2) Merge Cond: (role_permissions.role_id = assigned_roles.id) -> Sort (cost=74.32..74.62 rows=120 width=4) (actual time=1.167..1.183 rows=120 loops=2) Sort Key: role_permissions.role_id Sort Method: quicksort Memory: 30kB Worker 0: Sort Method: quicksort Memory: 30kB -> Seq Scan on role_permissions (cost=0.00..70.18 rows=120 width=4) (actual time=0.015..1.121 rows=121 loops=2) Filter: ((permission)::text = 'view_work_packages'::text) Rows Removed by Filter: 3104 -> Sort (cost=7.98..8.27 rows=113 width=8) (actual time=0.102..0.116 rows=116 loops=2) Sort Key: assigned_roles.id Sort Method: quicksort Memory: 30kB Worker 0: Sort Method: quicksort Memory: 30kB -> Seq Scan on roles assigned_roles (cost=0.00..4.13 rows=113 width=8) (actual time=0.015..0.044 rows=116 loops=2) Filter: (id IS NOT NULL) -> Materialize (cost=76.81..299.96 rows=127 width=17) (actual time=0.005..0.039 rows=193 loops=220) -> Hash Right Join (cost=76.81..299.32 rows=127 width=17) (actual time=0.548..0.776 rows=193 loops=2) Hash Cond: (members.project_id = projects.id) Join Filter: projects.active -> Nested Loop Left Join (cost=4.73..227.08 rows=25 width=12) (actual time=0.046..0.218 rows=68 loops=2) -> Bitmap Heap Scan on members (cost=4.44..69.05 rows=19 width=8) (actual time=0.027..0.056 rows=67 loops=2) Recheck Cond: (user_id = 2148) Heap Blocks: exact=12 -> Bitmap Index Scan on index_members_on_user_id_and_project_id (cost=0.00..4.43 rows=19 width=0) (actual time=0.021..0.021 rows=67 loops=2) Index Cond: (user_id = 2148) -> Index Scan using index_member_roles_on_member_id on member_roles (cost=0.29..8.31 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=134) Index Cond: (member_id = members.id) -> Hash (cost=70.89..70.89 rows=96 width=10) (actual time=0.488..0.491 rows=192 loops=2) Buckets: 1024 Batches: 1 Memory Usage: 17kB -> Hash Join (cost=53.25..70.89 rows=96 width=10) (actual time=0.277..0.443 rows=192 loops=2) Hash Cond: (enabled_modules.project_id = projects.id) -> Bitmap Heap Scan on enabled_modules (cost=15.16..31.81 rows=372 width=4) (actual time=0.061..0.137 rows=382 loops=2) Recheck Cond: ((name)::text = 'work_package_tracking'::text) Heap Blocks: exact=12 -> Bitmap Index Scan on index_enabled_modules_on_name (cost=0.00..15.07 rows=372 width=0) (actual time=0.052..0.052 rows=383 loops=2) Index Cond: ((name)::text = 'work_package_tracking'::text) -> Hash (cost=36.85..36.85 rows=99 width=6) (actual time=0.200..0.201 rows=195 loops=2) Buckets: 1024 Batches: 1 Memory Usage: 16kB -> Seq Scan on projects (cost=0.00..36.85 rows=99 width=6) (actual time=0.009..0.155 rows=195 loops=2) Filter: (active AND active) Rows Removed by Filter: 190 -> Index Only Scan using roles_pkey on roles permission_roles (cost=0.14..9.84 rows=113 width=4) (actual time=0.023..0.030 rows=33 loops=2) Heap Fetches: 6 Planning Time: 2.247 ms Execution Time: 61.963 ms ``` The key difference is in the number of loops in the first statement. |
3 years ago | |
---|---|---|
.. | ||
abstract_query.rb | removes distinct as rails will handle it if necessary | 3 years ago |
abstract_user_query.rb | remove ruby magic comment for utf-8 | 3 years ago |
enterprise_service.rb | remove ruby magic comment for utf-8 | 3 years ago |
project_query.rb | remove ruby magic comment for utf-8 | 3 years ago |
query_transformation.rb | remove ruby magic comment for utf-8 | 3 years ago |
query_transformation_visitor.rb | remove ruby magic comment for utf-8 | 3 years ago |
query_transformations.rb | remove ruby magic comment for utf-8 | 3 years ago |
query_transformations_order.rb | remove ruby magic comment for utf-8 | 3 years ago |
user_allowed_query.rb | remove ruby magic comment for utf-8 | 3 years ago |
user_allowed_service.rb | remove ruby magic comment for utf-8 | 3 years ago |
user_global_roles_query.rb | remove ruby magic comment for utf-8 | 3 years ago |
user_project_roles_query.rb | remove ruby magic comment for utf-8 | 3 years ago |
user_roles_query.rb | remove ruby magic comment for utf-8 | 3 years ago |