Detection of form refresh and callback!
You can use $form_state['triggering_element'] to find out if and by which element a form was submitted.

That said, I am not sure if what you want to do is possible. When rebuilding the form, you will have to provide all valid form elements and options for them again.

If that query is slow, you might be able to use the caching system instead (That is, unless these options are personalized for the current user).

But maybe I didn't exactly get what you meant, so try it..