Project

General

Profile

Actions

Task #1619

closed

Filtering of entities generate too many selects

Added by Vít Švanda about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Radek Tomiška
Category:
Database
Target version:
Start date:
04/24/2019
Due date:
% Done:

100%

Estimated time:
Owner:

Description

Example:

I have identity with 50 identity-account rows. If filter by identityId is executed, then 1 select for identity-accounts and 50 for every items are executed.

Actions #1

Updated by Vít Švanda about 5 years ago

  • Description updated (diff)
Actions #2

Updated by Vít Švanda about 5 years ago

  • Assignee changed from Vít Švanda to Radek Tomiška
Actions #3

Updated by Vít Švanda about 5 years ago

  • Status changed from In Progress to New
Actions #4

Updated by Vít Švanda about 5 years ago

  • Target version changed from Quartz (9.6.0) to Rhyolite (9.7.0)
Actions #5

Updated by Radek Tomiška almost 5 years ago

  • Status changed from New to In Progress
Actions #6

Updated by Radek Tomiška almost 5 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 0 to 50

I implemented extended spring repository and added fetch strategy to find queries:
https://github.com/bcvsolutions/CzechIdMng/commit/e8273fb38561d95cc6b9ef887d7bcf29cfc5191c

For the direct relation from the found entity are the selects reduced.

Could you do a feedback o this part, please?

TODO: Still remains selects for sub related entities.

Actions #7

Updated by Vít Švanda almost 5 years ago

  • Target version changed from Rhyolite (9.7.0) to Quartz (9.6.0)
Actions #8

Updated by Ondřej Kopr almost 5 years ago

  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 50 to 100

I checked same place as first time: Find identity account AbstractProvisioningExecutor#doProvisioning row 206. Identity with 13 identity account:

Before your changes: 38 queries. Time: 290 ms

After your changes: 18 queries. Time: 15 ms

The speedup this queries is about ~19x!!!

This new feature works for all subqueries. Thank you. Good job!

Good job!

Actions #9

Updated by Ondřej Kopr almost 5 years ago

  • Status changed from Needs feedback to Resolved
Actions #10

Updated by Radek Tomiška almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF