Slow blob sub_type 1 retrieval [CORE4601] #4916
Submitted by: brickman (brickman)
We are currently trying to optimise a Java application that performs a high number of Blob Sub Type 1 reads.
We initially raised an issue against the JayBird JDBC driver under JDBC369
To help us diagnose this issue, we developed a simple test application to populate a table with 100,000 rows with a varchar and a blob sub_type 1 column, and then capture the timings to read the entire contents of the table iterating through the java.sql.ResultSet. Both the blob and varchar contained the same text of 9 characters in length.
We found that when only reading the varchar, it took 450 milliseconds to read the 100,000 rows, with 100 milliseconds spent in reading the varchar column.
We respect that there is extra overhead in reading blob columns, however we felt that 30 seconds to retrieve 100,000 records may be excessive.
We ran our tests with the following setups. They all had similar results:
To get a comparison, we ran the same test against MySQL and PostgreSQL. The results were a lot faster:
During the assessment of the JayBird JDBC driver (JDBC369), it was advised that MySQL could achieve this performance by returning the blob data inline with the ResultSet.
Please advise if there is anything that can be done to optimise the blob retrieval, or if you require any additional information.
The text was updated successfully, but these errors were encountered:
Commented by: Michał Ziemski (r_o_o_k)
If the blob data you store is generally shorter than 32kb
select cast(blob_column as varchar(32000))
RIght now reading each blob is a round-trip to he server, so