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

Removing location textual fields indices from tables of db_views.py file #2676

Open
atalyaalon opened this issue Jun 25, 2024 · 6 comments
Open
Assignees
Milestone

Comments

@atalyaalon
Copy link
Collaborator

atalyaalon commented Jun 25, 2024

That's for the next milestone, but I want to keep documentation of this issue as we spoke about it in our last meeting

We can first:

  • Remove indices and make sure it does not harm the cache performance
    This includes removing text fields of yishuv_name and street1_hebrew and street2_hebrew and road_segment_name from the indices of the 5 DB tables markers_hebrew, involved_markers_hebrew, vehicles_hebrew, involved_hebrew if exist in them

And then:

  • discuss creating smaller tables (idea that was discussed in the past and was not implemented yet)
@ziv17
Copy link
Collaborator

ziv17 commented Aug 30, 2024

Hi @atalyaalon
We want to add the numeric indexes if they do not exist, right? (e.g. involved_markers_hebrew does not have street2 index.

@atalyaalon
Copy link
Collaborator Author

@ziv17 yes you are right.
And in table involved_markers_hebrew we also want to remove the street1_hebrew, street1_hebrew, accident_yishuv_name , road_segment_name, as you performed in this pr

@ziv17
Copy link
Collaborator

ziv17 commented Oct 28, 2024

Hi @atalyaalon ,
The 5 tables that are created in db_views.py are:

  • AccidentMarker, or markers
  • VehiclesView, or vehicles_hebrew
  • Involved, or involved
  • InvolvedView, or involved_hebrew
  • Vehicle, or vehicles

Are these the tables that I should work on?

@ziv17
Copy link
Collaborator

ziv17 commented Oct 28, 2024

Hi @atalyaalon ,
I might have asked you this already. If so, I apologize 😄
Currently the infographics API can accept text field as filters, and it replaces them with the corresponding numeric field. For this, it does a select with the given text field. If we keep this functionality, do we still want to remove the text indexes?

@atalyaalon
Copy link
Collaborator Author

@ziv17 can you add the like to the relevant code that does a select with the given text field?

@atalyaalon
Copy link
Collaborator Author

@ziv17 just a reminder, can you add the references to the locations we use the text fields as filters? I want to remove the text indices and replace them with numeric ones, but want to make sure this won't cause any performance issues in advance

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

No branches or pull requests

2 participants