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

[WIP] Remove owner concept #1181

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

[WIP] Remove owner concept #1181

wants to merge 5 commits into from

Conversation

wrigleyDan
Copy link
Contributor

Description

Motivation and Context

How Has This Been Tested?

Screenshots or GIFs (if appropriate):

Types of changes

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] Improvement (non-breaking change which improves existing functionality)
  • [] New feature (non-breaking change which adds new functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [] My code follows the code style of this project.
  • [] My change requires a change to the documentation.
  • [] I have updated the documentation accordingly.
  • [] I have read the CONTRIBUTING document.
  • [] I have added tests to cover my changes.
  • [] All new and existing tests passed.

@wrigleyDan wrigleyDan self-assigned this Jan 17, 2025
@wrigleyDan wrigleyDan linked an issue Jan 17, 2025 that may be closed by this pull request
8 tasks
@epugh
Copy link
Member

epugh commented Jan 18, 2025

I am going to poke at this... just in case I can get Quepid 8 out this weekend...

@epugh
Copy link
Member

epugh commented Jan 18, 2025

I changed my mind on pushing furthur... I think you have good progress! I'd love to get this in next week. Ping me about pairing if needed.

@epugh
Copy link
Member

epugh commented Jan 19, 2025

can't wait to see simpler quereis. This guy;s mean is 247 ms

SELECT DISTINCT cases.*, ( SELECT COUNT(queries.id) FROM queries WHERE case_id = cases.id ) AS queries_count, `cases`.`id` AS t0_r0, `case_metadata`.`user_id` AS t1_r0, `case_metadata`.`case_id` AS t1_r1, `case_metadata`.`last_viewed_at` AS t1_r2, `case_metadata`.`id` AS t1_r3 FROM `cases` LEFT OUTER JOIN `teams_cases` ON `teams_cases`.`case_id` = `cases`.`id` LEFT OUTER JOIN `teams` ON `teams`.`id` = `teams_cases`.`team_id` LEFT OUTER JOIN `teams_members` ON `teams_members`.`team_id` = `teams`.`id` LEFT OUTER JOIN `users` ON `users`.`id` = `teams_members`.`member_id` LEFT OUTER JOIN `case_metadata` ON `case_metadata`.`case_id` = `cases`.`id` WHERE (`teams_members`.`member_id` = 20 OR `cases`.`owner_id` = 20) AND (`cases`.`archived` = false OR `cases`.`archived` IS NULL) AND `cases`.`id` IN (8458, 8461, 6789, 6789, 601, 8461, 640, 8197, 8460, 3628, 1535, 8315, 6009, 7710, 8457, 4848, 4848, 4060, 601, 7713, 8217, 8239, 8239, 8215, 8217, 8215, 6789, 8197, 5541, 601) ORDER BY `case_metadata`.`last_viewed_at` ...

and this one is 1241ms:

SELECT DISTINCT `case_metadata`.`last_viewed_at`, `cases`.`id` AS alias_0, `cases`.`id` FROM `cases` LEFT OUTER JOIN `teams_cases` ON `teams_cases`.`case_id` = `cases`.`id` LEFT OUTER JOIN `teams` ON `teams`.`id` = `teams_cases`.`team_id` LEFT OUTER JOIN `teams_members` ON `teams_members`.`team_id` = `teams`.`id` LEFT OUTER JOIN `users` ON `users`.`id` = `teams_members`.`member_id` LEFT OUTER JOIN `case_metadata` ON `case_metadata`.`case_id` = `cases`.`id` WHERE (`teams_members`.`member_id` = 20 OR `cases`.`owner_id` = 20) AND (`cases`.`archived` = false OR `cases`.`archived` IS NULL) ORDER BY `case_metadata`.`last_viewed_at` DESC, `cases`.`id` DESC LIMIT 30

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.

Get rid of Owner concept
2 participants