asynchronous execution of long lasting queries? lazarus / 16-Databases ---------------------------------------------------------------------- tatamata · 2016-01-26 20:28 I have PostgreSQL queries that require extremely long time to finish execution and retrieve resultsets. The execution time can be anything between 30 seconds and 5 hours, in average it is 20 minutes. Since it is huge time and nothing can be done to enhance query speed, I have to deal with problem how to enable application responsiveness while queries are running in background...I presume not many people are willing to wait with frozen application for  few hours in order to retrieve some query results... What do you suggest, how to approach to this problem? Thanks. ---------------------------------------------------------------------- balazsszekely · 2016-01-26 20:34 @tatamata Run the queries in a worker thread, this way the GUI is not affected. Just search this forum threaded applications.