It's a desktop environment and there's one slow query with lots of joins. It currently executes when the user clicks a specific tab - instead of having to open the tab, and then click a button.
But if the user only wants to check an already inserted info, it will do the search again.
Three possibilities:
Confirm dialog: "Do you wish to update the search?" Options: Yes or No
Build a Search button again and execute the query only on click (our default approach)
Execute the query after n minutes