Opened 6 years ago

Closed 5 years ago

#1694 closed task (worksforme)

Search extremely inefficient

Reported by: jsfan Owned by: shevek
Priority: minor Milestone: 2.0
Component: BW Search Keywords:
Cc:

Description

The search currently runs a lot of SQL queries with every match leading to another query. Even at this point this an result to about 20K queries for just once search. With further growth of BW this WILL become an issue.

The original search query should be improved to include all necessary information for display to save the extra queries.

Change History (7)

comment:1 Changed 6 years ago by mahouni

That search function is a crazy construct! But if I remember correctly, the second query for the member details is done only on the matches of the current pagination, so only 25 or maximum 200 following queries?

If someone manages to do some optimizing and refactoring, it would be of course a great improvement. On the other hand there is also a risk to break working stuff. Also I think the map search works pretty good and fast at the moment. (except for one part in France and some areas around the polar region...).

comment:2 Changed 6 years ago by jsfan

You are right. I overlooked that it only runs against the limited query. However, this should still be bundeled into one query instead of using up 25. I suppose a change from "IdMember=<one id>" to "IdMember IN (<all ids>)" could already do. But I have to have a closer look at the code that handles the results first.

comment:3 Changed 6 years ago by jsfan

  • Milestone Future deleted

Milestone Future deleted

comment:4 Changed 6 years ago by shevek

  • Milestone set to unassigned
  • Owner set to shevek
  • Status changed from new to assigned

I check this as part of the search migration to geonames as I have to touch the queries anyway.

comment:5 Changed 6 years ago by shevek

  • Milestone changed from unassigned to 1.9

Add to milestone 1.9.

comment:6 Changed 5 years ago by shevek

  • Milestone changed from 1.9 to 1.10

Postponed to 1.10.

comment:7 Changed 5 years ago by shevek

  • Resolution set to worksforme
  • Status changed from assigned to closed

Combined several of the subqueries into the result fetching.

Closed.

Note: See TracTickets for help on using tickets.