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

[PB-2218]: feat/add-folders-depth #325

Closed
wants to merge 8 commits into from

Conversation

larry-internxt
Copy link
Contributor

  • Adds an indexed depth column to folders
  • Adds function to calculate folders depth by its parent depth
  • Adds function to recursively update all child depths if a parent is updated
  • Adds trigger before Create/Update folder: calculate its depth by using the parent
  • Adds trigger after Update folder: recalculate and fix all the child depths

@larry-internxt larry-internxt self-assigned this Jun 4, 2024
@larry-internxt larry-internxt changed the title [_]: feat/add-folders-depth [PB-2218]: feat/add-folders-depth Jun 4, 2024
apsantiso
apsantiso previously approved these changes Jun 12, 2024
@apsantiso apsantiso added the preview PR is selected for Preview Deployment label Jun 12, 2024
@apsantiso
Copy link
Collaborator

apsantiso commented Jun 13, 2024

/check-preview notify=true

Tip

Preview was successfully deployed

@inxtci inxtci added the deployed PR Preview is deployed label Jun 13, 2024
@apsantiso apsantiso removed preview PR is selected for Preview Deployment deployed PR Preview is deployed labels Jun 13, 2024
apsantiso
apsantiso previously approved these changes Jun 14, 2024
Copy link

sonarcloud bot commented Jun 14, 2024

Copy link

sonarcloud bot commented Sep 25, 2024

@larry-internxt
Copy link
Contributor Author

larry-internxt commented Oct 4, 2024

This solution is going to be killed. The DB cost of maintaining the depth (triggers, functions, etc) is too high compared to making nested selects whose performance (in query terms) is worse but not by much.

Now this is the analysis given this folders structure:
Level 1 with 5000 folders
|_ Level 2 with 5000 folders
|_ Level 3 with 5000 folders
|_ Level 4 with 5000 folders
|_ Level 5 <- here's the folder to check

Update all depths (migration):
Depth_1_Update all

Move a subfolder into a parent (all subfolders have to be updated recursively)
Depth_2_Move subfolder into parent folder

Get a folder by name and depth
Depth_2_Select exact folder

Get a folder by name (using nested selects and no depth)
NoDepth_1_NestedSelects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants