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

Migrate filters to use units summary #538

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Conversation

abbiefarr
Copy link

Issue

Description

Migrates existing filters to query the units summary table and not the units table.
Removes the units table join from the filter query.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Prototype/POC (not to merge)
  • This change is a refactor/address technical debt
  • This change requires a documentation update
  • This change requires a SQL Script

How Can This Be Tested/Reviewed?

Start the backend locally and run:
http://localhost:3100/listings?page=1&limit=10&filter[$comparison]=%3E=&filter[bedrooms]=1&filter[$comparison]=%3C=&filter[maxRent]=600

This previously would have mistakenly returned one listing, but now correctly returns no listings.

  • Desktop View
  • Mobile View

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have updated the changelog to include a description of my changes
  • I have run yarn generate:client if I made backend changes

Copy link

@avaleske avaleske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Out of curiosity, did you notice a performance difference after you stopped joining the full units table on the inner query?

@abbiefarr
Copy link
Author

No, I didn't see a noticeable difference. :(

@abbiefarr abbiefarr merged commit a968374 into main Sep 8, 2021
@abbiefarr abbiefarr deleted the filter-with-summary branch September 8, 2021 19:54
@plunkettgoogle plunkettgoogle mentioned this pull request Nov 12, 2021
21 tasks
seanmalbert pushed a commit that referenced this pull request Jun 23, 2022
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.

Migrate filters to use units summary
3 participants