This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Performing a query on a table that has a reasonably sized BLOB value results in the IDE producing high CPU usage and takes a relatively long time for the results to appear. Tested with h2database with the following structure create table if not exists msg_attachment ( id identity, file_name varchar(200) not null, file_data blob, file_size bigint, mime_type varchar(100), created timestamp ); Created 3 records, 146KiB, 1.6MIB, 302MiB, these result in < 1sec, ~3sec, ~10 minute execution times for select * from msg_attachment, changing to select id returns atomically. I understand that this would be due to the IDE saving the results out to a file to support opening the documents after the ResultSet has closed. I think this should be optional, and; I think this support needs improving, testing using spring and downloading the files manually results in the 302MiB file saving in ~2 seconds (from same machine using SSD disks).
Created attachment 156699 [details] Add missing write(byte[] b, int offset, int len) method to RandomAccessOutputStream Thank you for finding this Brett, I had this on my notepad, but my checks were with much smaller blob, which had less impact. I can verify your results and agree, that this is unacceptable. I'll have to check whether I can get the fix into 8.1 as the release has hit high resistance mode. I attached the patch here, if you can it would be good if you could do a netbeans build with that applied to verify the patch.
The fix is pushed as: http://hg.netbeans.org/core-main/rev/9f966a7d730e As usual in the next few days a nightly build will be available that contains this fix. Please check that build (a message is posted here when it is done) and report whether or not you think this bug is resolved by it. I'll try to get it into the release if you can verify the fix.
*** Bug 255847 has been marked as a duplicate of this bug. ***
Integrated into 'main-silver', will be available in build *201510150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/9f966a7d730e User: Matthias Blaesing <matthias42@netbeans.org> Log: #255879: Querying blob columns results in excessive CPU usage Cause: missing delegation/override of "write(byte[] data, int offset, int len)" in RandomAccessOutputStream
Brett, can you please urgently verify Matthias' bug fix in the last development build #201510150002 [1]? Thanks a lot! [1] http://bits.netbeans.org/dev/nightly/latest/
Apologies, will get onto it today, I've just been a bit busy with my wife in hospital. TBH I still feel that 255498 and 249248 are MUCH more important than this one. I think this issue may already exist in 8.0.2 anyway.
Thanks guys, verified fix and is working fine. Apologies for the delay in testing.
This should be fixed in the first available 8.1 patch.
Patch was transplanted into release81 as: http://hg.netbeans.org/releases/rev/4ad5f2043d59 http://hg.netbeans.org/releases/rev/8b44ea3c8f9f Target Milestone should be 8.1.1, as this is not present as value, value was left as Dev. The patch can be verified by: 1. Create a table with at least one blob column 2. Add some large blobs to the table 3. Query the table (select * from <table>) With four rows and a blob size of 10MB on an mysql server. I measured (realtime, not reported time): Without the patch: ~ 40s fetch time With the patch: ~2s fetch time The patch is also visible when inserting/updating blobs, the data is first read into the pseudo blob and this is process is also much faster (not measured).
Thanks a lot Matthias!