* Robert DiFalco <[EMAIL PROTECTED]> [06/04/30 03:09]:

> Thanks Sergei, it's nice to know for sure. Do you know if there is any
> documentation on how memory is used to store LOB data? For example, is
> it a percentage of the total buffer pool size or is it allocated from
> available memory un-allocated to the buffer pool size? 

There is no streaming interface between the SQL layer and the
storage engines layer.  An engine operates with at least one
column, not with a piece of a column (one exception is that we
can use row IDs when walking through records in a join, in
this case the LOB is not loaded).

So, at first the LOB is assembled on the SQL layer (e.g. if you supply
a LOB object in pieces via mysql_stmt_send_long_data), and then
submitted to the storage layer. This means than when inserting a
LOB the server creates at least two copies of it in memory  - on 
the SQL layer and on the storage layer.

If instead of mysql_stmt_send_long_data you use the text protocol
and simply encode the LOB in the query text with
mysql_real_escape_string, you get one more copy - in the text of
the query itself, which is also kept in memory.

-- 
-- Konstantin Osipov              Software Developer, Moscow, Russia
-- MySQL AB, www.mysql.com   The best DATABASE COMPANY in the GALAXY

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to