Bug #86578 Workbench is unresponsive after refocusing with a large selection selected
Submitted: 4 Jun 2017 13:27 Modified: 18 Jun 2017 14:23
Reporter: Lee Butler Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:6.3.9 OS:Microsoft Windows (10)
Assigned to: CPU Architecture:Any
Tags: sql editor, workbench

[4 Jun 2017 13:27] Lee Butler
Description:
Workbench freezes when it is reactivated if a large amount of cells in the results grid are selected. This is noticed on a selection involving at least 30k cells in the results grid, across about 10k rows. 

Each time this happens while workbench is running the delay gets worse. It may be limited to selecting all cells and then copying them from workbench into another application, so it might be the clipboard interaction, or it might be the selection part. 

This freeze also invoices high CPU usage from workbench (Consistently around 35% usage on an i5-4460)

How to repeat:
SELECT a large amount of rows from a table. 10k should easily do the trick. 

Ctrl A to select all (I'm not sure if selecting all is a required part but it definitely causes it to happen)and then (at least I was doing this anyway)copy it to your clipboard. 

If you want to, you can then paste it into another applicaiton (I was pasting into Excel.

Return to workbench and wait a while for it to respond. Rinse and repeat until workbench stops recovering from the freeze.
[4 Jun 2017 17:34] Miguel Solorzano
Thank you for the bug report. I think this issue has the same root cause as bug you reported https://bugs.mysql.com/bug.php?id=86579 (handle of large data set), you agree?. Thanks in advance.
[4 Jun 2017 18:49] Lee Butler
I'm not sure it is, but it will depend on the control used for the results grid. 

I'll have a look shortly but the results grid looks to be a System.Windows.Forms.DataGridView (or something derived from it) which seems to usually have decent handling on ctrl a ctrl c, which can copy 200k cells pretty easily with just a little lag when actually copying to the clipboard. I don't notice anything when reactivating the window on it in my own applications. 

I think the DataGridView uses some Win32 calls to do it's huge copy job, where building a massive .Net managed string makes the framework go a bit crazy. 

They might be related but I'm not sure. Unless there's some custom handling on the results grid for selections or doing something on refocus. Though that reminds me of another issue which I'll make sure I can reproduce first before putting it here, but it does make me think something is going on while workbench is "idle"
[5 Jun 2017 13:20] Miguel Solorzano
Thank you for the feedback.
[18 Jun 2017 14:23] Lee Butler
Just to extend thi s alittle, refocus is not actually required. I've just verified it happens if you just click the grid the everything selected immediately after selecting.

Workbench will not recover at all in this instance. Or at least not after about 25 minutes of waiting. Tested with 21k rows and 16 columns