Hi,

Our reporting DB can generate queries that take a long time to execute. 
When filters on our web app changes a new DB query is run, each one is 
expensive.

For e.g.:

   - Change filters
   - HTTP request, A, to reporting endpoint causes expensive query (takes 
   10 secs)
   - 1 second later
   - Change filters
   - HTTP request, B, to reporting endpoint causes expensive query (takes 
   10 secs)
   - 1 second later
   - Change filters
   - HTTP request, C, to reporting endpoint causes expensive query (takes 
   10 secs)
   
Now, I have three expensive queries running but I don't care about the 
results returned from A and B. *How can I find and cancel the queries due 
to A and B?*

One approach being considered:

Tag the DB queries we make with a UUID coming with the HTTP request. Have 
the front-end hold that latest query UUID requested and send a cancellation 
request along with a new one when the report changes.

I can tag the dataset with `ds.comment("uuid: #{uuid}")` by using the 
sql_comments extension. *How can I find the connection that's executing the 
query for that tagged dataset in order to cancel the query?*

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/f9377309-1d6b-4f0e-93fa-dc6f60ede893n%40googlegroups.com.

Reply via email to