Keith,
I think you’re getting too caught-up in the article and missing the whole intention of it.
BLOBs and LOBs are a way database designers came up with to store chunks of data that are larger than your typical record field size of 255 bytes/characters.
Almost every database now supports them, and every API supports them.
What someone else said earlier is very relevant: the size of these is typically limited by file system attributes, namely whatever chunk size the fs reads and writes to disk. That ensures that each LOB field read/write corresponds to exactly one read/write operation to disk.
I forget the exact terminology for these chunks, but I’ll call them sectors here.
This is not a MySQL thing — it’s dependent on your file system. Some have 512 byte sectors, some 2048, some 4096, and some are larger.
Oracle has the ability to be tuned so you can have different sector sizes (on different devices) and each one will read/write that particular size.
This is a very important characteristic when it comes to tuning databases for high-performance applications.
Because it’s file-system dependent, my guess is there’s a parameter somewhere that’s used to build the database and various APIs / libs so they use that value.
If you rebuild your fs using a different sector size, then you can imagine there’s no possible way for the docs to reflect that, right?
Unless you’re building a very large database with high transaction rates that needs absolutely optimal throughput, then this isn’t something you’d need to worry about.
Whatever your file-system’s sector size is, that’s the granularity of LOBs/BLOBs. Everything else is (ideally) adapted to that. Now, whether they are or not is another matter. But the historical nature of Linux where you rebuild things as they’re installed helps ensure that this is the case.
I appreciate your feedback. I am looking for information specifically about PHP / PDO / Large Objects based on the manual page
http://www.php.net/manual/en/pdo.lobs.phpMaybe ODBC is the answer to my question. Maybe dealing with large objects has to do with using the ODBC driver with PHP's PDO class. The article does not say that though.
Note that the MySqli extension manual dos not mention large objects. I am guessing the large object issue is and ODBC issue because it is not specific to MySql.
Anyone using PDO with MySql?
Thanks!!
Keith
Hi Keith,
For the record I wasn't trying to imply that binary data is the *only* use case for large objects (or streaming in general) but it's far and away the most common usage pattern. 4kb isn't really a hard limit but most database systems will consider data larger than 4kb "large" because of file system block sizes. A database server is one of those rare use cases where heavy optimization is important, especially for i/o, so 4kb is called out specifically because that's more often than not the block size of the filesystem. In heavily simplified terms, this means writes
over 4kb are actually multiple writes to disk which can have some interesting implications for optimized ACID compliant databases.
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss