c# DataSet.Fill dreadful performance issues with Firebird 2.5
REMARK I completely rewrite the question as while exploring options and getting insights, I realized the origin of my problem was not at all what I thought.
I use Firebird as a database engine and the standard .Net provider (v.5.11.0) to fetch data using following code:
// myBlob1 is BLOB SUB_TYPE 1 (text field) with some empty, but some
// VERY long stuff (xml-content) which exceeds VARCHAR(32765), but I removed
// those before performing my tests!!!
var tick = Stopwatch.StartNew();
DataTable dataTable = new DataTable();
DbLive.Open();
FbCommand command = new FbCommand("SELECT myBlob FROM MY_TABLE", DbLive);
try {
dataTable.BeginLoadData();
FbDataAdapter fda = new FbDataAdapter(command);
fda.Fill(dataTable);
dataTable.EndLoadData();
}
command.Dispose();
DbLive.Close();
tick.Stop();
Console.WriteLine("Execution time: " + tick.ElapsedMilliseconds + " [ms]");
I am fetching about 30k rows with, in total, about 16Mb of data (according to database workbench's statistics) but only 20k rows with non-null data.
So I go fetching the whole thing using naive approach, then I used the cast (VARCHAR(8192))
approach (note that I removed all rows with > 8192 characters before doing the tests). Now, here are the results :
// Obtained when loading data over wifi, with a bandwidth of about 100Mbps)
// the performance on local machine did not make a big difference!)
No casting: 73287.0788 ms
With casting: 2360.2244 ms
There really is something bad going on with Blobs
here. I tested performance using Firebird 3 and compression, but results weren't much better (a very small improvement, but difference is still of the same order of magnitude).
To the point:
1. Can I expect an improvement if I use another provider (e.g. www.ibprovider.com
as suggested, but I was not able to test it)
2. Is this a known issue on other database engines, or is there hope to get improvements by changing to another engine?
c# performance firebird firebird2.5 dataadapter
|
show 8 more comments
REMARK I completely rewrite the question as while exploring options and getting insights, I realized the origin of my problem was not at all what I thought.
I use Firebird as a database engine and the standard .Net provider (v.5.11.0) to fetch data using following code:
// myBlob1 is BLOB SUB_TYPE 1 (text field) with some empty, but some
// VERY long stuff (xml-content) which exceeds VARCHAR(32765), but I removed
// those before performing my tests!!!
var tick = Stopwatch.StartNew();
DataTable dataTable = new DataTable();
DbLive.Open();
FbCommand command = new FbCommand("SELECT myBlob FROM MY_TABLE", DbLive);
try {
dataTable.BeginLoadData();
FbDataAdapter fda = new FbDataAdapter(command);
fda.Fill(dataTable);
dataTable.EndLoadData();
}
command.Dispose();
DbLive.Close();
tick.Stop();
Console.WriteLine("Execution time: " + tick.ElapsedMilliseconds + " [ms]");
I am fetching about 30k rows with, in total, about 16Mb of data (according to database workbench's statistics) but only 20k rows with non-null data.
So I go fetching the whole thing using naive approach, then I used the cast (VARCHAR(8192))
approach (note that I removed all rows with > 8192 characters before doing the tests). Now, here are the results :
// Obtained when loading data over wifi, with a bandwidth of about 100Mbps)
// the performance on local machine did not make a big difference!)
No casting: 73287.0788 ms
With casting: 2360.2244 ms
There really is something bad going on with Blobs
here. I tested performance using Firebird 3 and compression, but results weren't much better (a very small improvement, but difference is still of the same order of magnitude).
To the point:
1. Can I expect an improvement if I use another provider (e.g. www.ibprovider.com
as suggested, but I was not able to test it)
2. Is this a known issue on other database engines, or is there hope to get improvements by changing to another engine?
c# performance firebird firebird2.5 dataadapter
Well, we know we are not looking at the real code because the snippet will always throw an exception. So what don't we know that you should have told us?
– Hans Passant
Oct 10 '17 at 18:21
My bad got lost with formatting... The throw should of course be in brackets...
– neggenbe
Oct 10 '17 at 21:21
1
Flamerobin by default doesn't fetch all rows, it will only fetch a few pages, and flamerobin will not fetch blobs by default (only on-demand). The same probably applies to Database Workbench.
– Mark Rotteveel
Oct 11 '17 at 9:49
2
BLOBs are stored out of the table and do require additional network round-trip. So when in network speed bottlenecked situation it indeed might decrease the throughput 2-3 times. Are you blobs really big ? You can try to un-blob themselect ... cast (BlobField as VarChar(1024)) ... from ....
Note however, that total row size is limited with 32 KBytes on Firebird, and that UTF-8 encoded strings/blobs take 4 bytes per letter
– Arioch 'The
Oct 11 '17 at 10:24
1
u still neither showed SQL Schema for the table, nor commented on BLOB-less query approach. I can only say that// iterate throw each without doing anything
B method does NOT fetch BLOBs, so is incorrect to compete. You really should set all the data. So is Dapper<T> is T record does not include some BLOB filed
– Arioch 'The
Oct 11 '17 at 16:37
|
show 8 more comments
REMARK I completely rewrite the question as while exploring options and getting insights, I realized the origin of my problem was not at all what I thought.
I use Firebird as a database engine and the standard .Net provider (v.5.11.0) to fetch data using following code:
// myBlob1 is BLOB SUB_TYPE 1 (text field) with some empty, but some
// VERY long stuff (xml-content) which exceeds VARCHAR(32765), but I removed
// those before performing my tests!!!
var tick = Stopwatch.StartNew();
DataTable dataTable = new DataTable();
DbLive.Open();
FbCommand command = new FbCommand("SELECT myBlob FROM MY_TABLE", DbLive);
try {
dataTable.BeginLoadData();
FbDataAdapter fda = new FbDataAdapter(command);
fda.Fill(dataTable);
dataTable.EndLoadData();
}
command.Dispose();
DbLive.Close();
tick.Stop();
Console.WriteLine("Execution time: " + tick.ElapsedMilliseconds + " [ms]");
I am fetching about 30k rows with, in total, about 16Mb of data (according to database workbench's statistics) but only 20k rows with non-null data.
So I go fetching the whole thing using naive approach, then I used the cast (VARCHAR(8192))
approach (note that I removed all rows with > 8192 characters before doing the tests). Now, here are the results :
// Obtained when loading data over wifi, with a bandwidth of about 100Mbps)
// the performance on local machine did not make a big difference!)
No casting: 73287.0788 ms
With casting: 2360.2244 ms
There really is something bad going on with Blobs
here. I tested performance using Firebird 3 and compression, but results weren't much better (a very small improvement, but difference is still of the same order of magnitude).
To the point:
1. Can I expect an improvement if I use another provider (e.g. www.ibprovider.com
as suggested, but I was not able to test it)
2. Is this a known issue on other database engines, or is there hope to get improvements by changing to another engine?
c# performance firebird firebird2.5 dataadapter
REMARK I completely rewrite the question as while exploring options and getting insights, I realized the origin of my problem was not at all what I thought.
I use Firebird as a database engine and the standard .Net provider (v.5.11.0) to fetch data using following code:
// myBlob1 is BLOB SUB_TYPE 1 (text field) with some empty, but some
// VERY long stuff (xml-content) which exceeds VARCHAR(32765), but I removed
// those before performing my tests!!!
var tick = Stopwatch.StartNew();
DataTable dataTable = new DataTable();
DbLive.Open();
FbCommand command = new FbCommand("SELECT myBlob FROM MY_TABLE", DbLive);
try {
dataTable.BeginLoadData();
FbDataAdapter fda = new FbDataAdapter(command);
fda.Fill(dataTable);
dataTable.EndLoadData();
}
command.Dispose();
DbLive.Close();
tick.Stop();
Console.WriteLine("Execution time: " + tick.ElapsedMilliseconds + " [ms]");
I am fetching about 30k rows with, in total, about 16Mb of data (according to database workbench's statistics) but only 20k rows with non-null data.
So I go fetching the whole thing using naive approach, then I used the cast (VARCHAR(8192))
approach (note that I removed all rows with > 8192 characters before doing the tests). Now, here are the results :
// Obtained when loading data over wifi, with a bandwidth of about 100Mbps)
// the performance on local machine did not make a big difference!)
No casting: 73287.0788 ms
With casting: 2360.2244 ms
There really is something bad going on with Blobs
here. I tested performance using Firebird 3 and compression, but results weren't much better (a very small improvement, but difference is still of the same order of magnitude).
To the point:
1. Can I expect an improvement if I use another provider (e.g. www.ibprovider.com
as suggested, but I was not able to test it)
2. Is this a known issue on other database engines, or is there hope to get improvements by changing to another engine?
c# performance firebird firebird2.5 dataadapter
c# performance firebird firebird2.5 dataadapter
edited Oct 12 '17 at 12:33
neggenbe
asked Oct 10 '17 at 15:40
neggenbeneggenbe
636826
636826
Well, we know we are not looking at the real code because the snippet will always throw an exception. So what don't we know that you should have told us?
– Hans Passant
Oct 10 '17 at 18:21
My bad got lost with formatting... The throw should of course be in brackets...
– neggenbe
Oct 10 '17 at 21:21
1
Flamerobin by default doesn't fetch all rows, it will only fetch a few pages, and flamerobin will not fetch blobs by default (only on-demand). The same probably applies to Database Workbench.
– Mark Rotteveel
Oct 11 '17 at 9:49
2
BLOBs are stored out of the table and do require additional network round-trip. So when in network speed bottlenecked situation it indeed might decrease the throughput 2-3 times. Are you blobs really big ? You can try to un-blob themselect ... cast (BlobField as VarChar(1024)) ... from ....
Note however, that total row size is limited with 32 KBytes on Firebird, and that UTF-8 encoded strings/blobs take 4 bytes per letter
– Arioch 'The
Oct 11 '17 at 10:24
1
u still neither showed SQL Schema for the table, nor commented on BLOB-less query approach. I can only say that// iterate throw each without doing anything
B method does NOT fetch BLOBs, so is incorrect to compete. You really should set all the data. So is Dapper<T> is T record does not include some BLOB filed
– Arioch 'The
Oct 11 '17 at 16:37
|
show 8 more comments
Well, we know we are not looking at the real code because the snippet will always throw an exception. So what don't we know that you should have told us?
– Hans Passant
Oct 10 '17 at 18:21
My bad got lost with formatting... The throw should of course be in brackets...
– neggenbe
Oct 10 '17 at 21:21
1
Flamerobin by default doesn't fetch all rows, it will only fetch a few pages, and flamerobin will not fetch blobs by default (only on-demand). The same probably applies to Database Workbench.
– Mark Rotteveel
Oct 11 '17 at 9:49
2
BLOBs are stored out of the table and do require additional network round-trip. So when in network speed bottlenecked situation it indeed might decrease the throughput 2-3 times. Are you blobs really big ? You can try to un-blob themselect ... cast (BlobField as VarChar(1024)) ... from ....
Note however, that total row size is limited with 32 KBytes on Firebird, and that UTF-8 encoded strings/blobs take 4 bytes per letter
– Arioch 'The
Oct 11 '17 at 10:24
1
u still neither showed SQL Schema for the table, nor commented on BLOB-less query approach. I can only say that// iterate throw each without doing anything
B method does NOT fetch BLOBs, so is incorrect to compete. You really should set all the data. So is Dapper<T> is T record does not include some BLOB filed
– Arioch 'The
Oct 11 '17 at 16:37
Well, we know we are not looking at the real code because the snippet will always throw an exception. So what don't we know that you should have told us?
– Hans Passant
Oct 10 '17 at 18:21
Well, we know we are not looking at the real code because the snippet will always throw an exception. So what don't we know that you should have told us?
– Hans Passant
Oct 10 '17 at 18:21
My bad got lost with formatting... The throw should of course be in brackets...
– neggenbe
Oct 10 '17 at 21:21
My bad got lost with formatting... The throw should of course be in brackets...
– neggenbe
Oct 10 '17 at 21:21
1
1
Flamerobin by default doesn't fetch all rows, it will only fetch a few pages, and flamerobin will not fetch blobs by default (only on-demand). The same probably applies to Database Workbench.
– Mark Rotteveel
Oct 11 '17 at 9:49
Flamerobin by default doesn't fetch all rows, it will only fetch a few pages, and flamerobin will not fetch blobs by default (only on-demand). The same probably applies to Database Workbench.
– Mark Rotteveel
Oct 11 '17 at 9:49
2
2
BLOBs are stored out of the table and do require additional network round-trip. So when in network speed bottlenecked situation it indeed might decrease the throughput 2-3 times. Are you blobs really big ? You can try to un-blob them
select ... cast (BlobField as VarChar(1024)) ... from ....
Note however, that total row size is limited with 32 KBytes on Firebird, and that UTF-8 encoded strings/blobs take 4 bytes per letter– Arioch 'The
Oct 11 '17 at 10:24
BLOBs are stored out of the table and do require additional network round-trip. So when in network speed bottlenecked situation it indeed might decrease the throughput 2-3 times. Are you blobs really big ? You can try to un-blob them
select ... cast (BlobField as VarChar(1024)) ... from ....
Note however, that total row size is limited with 32 KBytes on Firebird, and that UTF-8 encoded strings/blobs take 4 bytes per letter– Arioch 'The
Oct 11 '17 at 10:24
1
1
u still neither showed SQL Schema for the table, nor commented on BLOB-less query approach. I can only say that
// iterate throw each without doing anything
B method does NOT fetch BLOBs, so is incorrect to compete. You really should set all the data. So is Dapper<T> is T record does not include some BLOB filed– Arioch 'The
Oct 11 '17 at 16:37
u still neither showed SQL Schema for the table, nor commented on BLOB-less query approach. I can only say that
// iterate throw each without doing anything
B method does NOT fetch BLOBs, so is incorrect to compete. You really should set all the data. So is Dapper<T> is T record does not include some BLOB filed– Arioch 'The
Oct 11 '17 at 16:37
|
show 8 more comments
2 Answers
2
active
oldest
votes
I got a bit confused about many things with the above, so let me clarify some insights:
FbDataReader
and theDapper
approaches did, in fact, NOT load the blob fields, so performance was indeed irrelevant;
Using the
CAST
toVARCHAR(4096)
did show significant performance improvements (note that here, I tested the text-blob's content to fully match, which did work):
DataTable no cast: 73287.0788 ms
FbDataReader cast: 2224.1387 ms
DataTable cast: 2360.2244 ms
I even tried with Firebird 3 using compression, without significant improvement. So it is indeed the fact I use BLOB
instead of large VARCHAR
that caused the problem.
Note that I did not succeed in testing with another provider.
Bottom line : using BLOB SUBTYPE 1
kills my performance here, I should use VARCHAR
instead.
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
add a comment |
I encountered a similar performance issue when using Firebird 3 embedded and FBDataAdapter to read BLOB text fields. The query itself didn't seem to be the problem - it executed pretty quickly in Flamerobin. Than I noticed that Visual Studio was reporting a long series of:
Microsoft C++ exception: Firebird::status_exception at memory location
0x0000007DD010B920
although these exceptions are not seen by the calling .Net application.
It turned out that much of the slowdown was apparently due to the Visual Studio IDE trying to handle the many exceptions that are raised. There's a "quiet" exception raised for every BLOB field that is read. This occurs when reading "segments" of the BLOB via isc_get_segment
, which is called repeatedly until all segements have been read. isc_get_segement
apparently throws an exception behind the scenes when the end of data is encountered.
When I'm running under the Visual Studio IDE and debugger, this slows things way down, but performance is reasonable if I run the application on its own.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46670733%2fc-sharp-dataset-fill-dreadful-performance-issues-with-firebird-2-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I got a bit confused about many things with the above, so let me clarify some insights:
FbDataReader
and theDapper
approaches did, in fact, NOT load the blob fields, so performance was indeed irrelevant;
Using the
CAST
toVARCHAR(4096)
did show significant performance improvements (note that here, I tested the text-blob's content to fully match, which did work):
DataTable no cast: 73287.0788 ms
FbDataReader cast: 2224.1387 ms
DataTable cast: 2360.2244 ms
I even tried with Firebird 3 using compression, without significant improvement. So it is indeed the fact I use BLOB
instead of large VARCHAR
that caused the problem.
Note that I did not succeed in testing with another provider.
Bottom line : using BLOB SUBTYPE 1
kills my performance here, I should use VARCHAR
instead.
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
add a comment |
I got a bit confused about many things with the above, so let me clarify some insights:
FbDataReader
and theDapper
approaches did, in fact, NOT load the blob fields, so performance was indeed irrelevant;
Using the
CAST
toVARCHAR(4096)
did show significant performance improvements (note that here, I tested the text-blob's content to fully match, which did work):
DataTable no cast: 73287.0788 ms
FbDataReader cast: 2224.1387 ms
DataTable cast: 2360.2244 ms
I even tried with Firebird 3 using compression, without significant improvement. So it is indeed the fact I use BLOB
instead of large VARCHAR
that caused the problem.
Note that I did not succeed in testing with another provider.
Bottom line : using BLOB SUBTYPE 1
kills my performance here, I should use VARCHAR
instead.
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
add a comment |
I got a bit confused about many things with the above, so let me clarify some insights:
FbDataReader
and theDapper
approaches did, in fact, NOT load the blob fields, so performance was indeed irrelevant;
Using the
CAST
toVARCHAR(4096)
did show significant performance improvements (note that here, I tested the text-blob's content to fully match, which did work):
DataTable no cast: 73287.0788 ms
FbDataReader cast: 2224.1387 ms
DataTable cast: 2360.2244 ms
I even tried with Firebird 3 using compression, without significant improvement. So it is indeed the fact I use BLOB
instead of large VARCHAR
that caused the problem.
Note that I did not succeed in testing with another provider.
Bottom line : using BLOB SUBTYPE 1
kills my performance here, I should use VARCHAR
instead.
I got a bit confused about many things with the above, so let me clarify some insights:
FbDataReader
and theDapper
approaches did, in fact, NOT load the blob fields, so performance was indeed irrelevant;
Using the
CAST
toVARCHAR(4096)
did show significant performance improvements (note that here, I tested the text-blob's content to fully match, which did work):
DataTable no cast: 73287.0788 ms
FbDataReader cast: 2224.1387 ms
DataTable cast: 2360.2244 ms
I even tried with Firebird 3 using compression, without significant improvement. So it is indeed the fact I use BLOB
instead of large VARCHAR
that caused the problem.
Note that I did not succeed in testing with another provider.
Bottom line : using BLOB SUBTYPE 1
kills my performance here, I should use VARCHAR
instead.
edited Oct 12 '17 at 12:19
Mark Rotteveel
59.5k1476119
59.5k1476119
answered Oct 12 '17 at 7:46
neggenbeneggenbe
636826
636826
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
add a comment |
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
Clarifying things is good. Clarifying things in wrong places is bad and confusing. Please, 1) edit your QUESTION and add them new details there, 2) add the comment under the Q notifying people you updated the Q with more details, 3) delete this "answer" because it is not an answer at all
– Arioch 'The
Oct 12 '17 at 11:15
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
I edited your answer and removed the parts that should be considered follow-up questions. Note that those follow-up questions might be better suited for the firebird-devel or firebird-net-provider mailing lists than Stack Overflow.
– Mark Rotteveel
Oct 12 '17 at 12:20
add a comment |
I encountered a similar performance issue when using Firebird 3 embedded and FBDataAdapter to read BLOB text fields. The query itself didn't seem to be the problem - it executed pretty quickly in Flamerobin. Than I noticed that Visual Studio was reporting a long series of:
Microsoft C++ exception: Firebird::status_exception at memory location
0x0000007DD010B920
although these exceptions are not seen by the calling .Net application.
It turned out that much of the slowdown was apparently due to the Visual Studio IDE trying to handle the many exceptions that are raised. There's a "quiet" exception raised for every BLOB field that is read. This occurs when reading "segments" of the BLOB via isc_get_segment
, which is called repeatedly until all segements have been read. isc_get_segement
apparently throws an exception behind the scenes when the end of data is encountered.
When I'm running under the Visual Studio IDE and debugger, this slows things way down, but performance is reasonable if I run the application on its own.
add a comment |
I encountered a similar performance issue when using Firebird 3 embedded and FBDataAdapter to read BLOB text fields. The query itself didn't seem to be the problem - it executed pretty quickly in Flamerobin. Than I noticed that Visual Studio was reporting a long series of:
Microsoft C++ exception: Firebird::status_exception at memory location
0x0000007DD010B920
although these exceptions are not seen by the calling .Net application.
It turned out that much of the slowdown was apparently due to the Visual Studio IDE trying to handle the many exceptions that are raised. There's a "quiet" exception raised for every BLOB field that is read. This occurs when reading "segments" of the BLOB via isc_get_segment
, which is called repeatedly until all segements have been read. isc_get_segement
apparently throws an exception behind the scenes when the end of data is encountered.
When I'm running under the Visual Studio IDE and debugger, this slows things way down, but performance is reasonable if I run the application on its own.
add a comment |
I encountered a similar performance issue when using Firebird 3 embedded and FBDataAdapter to read BLOB text fields. The query itself didn't seem to be the problem - it executed pretty quickly in Flamerobin. Than I noticed that Visual Studio was reporting a long series of:
Microsoft C++ exception: Firebird::status_exception at memory location
0x0000007DD010B920
although these exceptions are not seen by the calling .Net application.
It turned out that much of the slowdown was apparently due to the Visual Studio IDE trying to handle the many exceptions that are raised. There's a "quiet" exception raised for every BLOB field that is read. This occurs when reading "segments" of the BLOB via isc_get_segment
, which is called repeatedly until all segements have been read. isc_get_segement
apparently throws an exception behind the scenes when the end of data is encountered.
When I'm running under the Visual Studio IDE and debugger, this slows things way down, but performance is reasonable if I run the application on its own.
I encountered a similar performance issue when using Firebird 3 embedded and FBDataAdapter to read BLOB text fields. The query itself didn't seem to be the problem - it executed pretty quickly in Flamerobin. Than I noticed that Visual Studio was reporting a long series of:
Microsoft C++ exception: Firebird::status_exception at memory location
0x0000007DD010B920
although these exceptions are not seen by the calling .Net application.
It turned out that much of the slowdown was apparently due to the Visual Studio IDE trying to handle the many exceptions that are raised. There's a "quiet" exception raised for every BLOB field that is read. This occurs when reading "segments" of the BLOB via isc_get_segment
, which is called repeatedly until all segements have been read. isc_get_segement
apparently throws an exception behind the scenes when the end of data is encountered.
When I'm running under the Visual Studio IDE and debugger, this slows things way down, but performance is reasonable if I run the application on its own.
edited Nov 13 '18 at 23:50
Samuel Liew♦
44.3k32113148
44.3k32113148
answered Nov 12 '18 at 5:32
Eric ZurcherEric Zurcher
173
173
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f46670733%2fc-sharp-dataset-fill-dreadful-performance-issues-with-firebird-2-5%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Well, we know we are not looking at the real code because the snippet will always throw an exception. So what don't we know that you should have told us?
– Hans Passant
Oct 10 '17 at 18:21
My bad got lost with formatting... The throw should of course be in brackets...
– neggenbe
Oct 10 '17 at 21:21
1
Flamerobin by default doesn't fetch all rows, it will only fetch a few pages, and flamerobin will not fetch blobs by default (only on-demand). The same probably applies to Database Workbench.
– Mark Rotteveel
Oct 11 '17 at 9:49
2
BLOBs are stored out of the table and do require additional network round-trip. So when in network speed bottlenecked situation it indeed might decrease the throughput 2-3 times. Are you blobs really big ? You can try to un-blob them
select ... cast (BlobField as VarChar(1024)) ... from ....
Note however, that total row size is limited with 32 KBytes on Firebird, and that UTF-8 encoded strings/blobs take 4 bytes per letter– Arioch 'The
Oct 11 '17 at 10:24
1
u still neither showed SQL Schema for the table, nor commented on BLOB-less query approach. I can only say that
// iterate throw each without doing anything
B method does NOT fetch BLOBs, so is incorrect to compete. You really should set all the data. So is Dapper<T> is T record does not include some BLOB filed– Arioch 'The
Oct 11 '17 at 16:37