Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler Class Reference
Collaboration diagram for SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler:
Collaboration graph
[legend]

Public Member Functions

 getTableFields ()
 
 getFetchFields ()
 
 getTableIndexes ()
 
 getWhereConds (DataItem $dataItem)
 
 getInsertValues (DataItem $dataItem)
 
 getIndexField ()
 
 getLabelField ()
 
 dataItemFromDBKeys ($dbkeys)
 
- Public Member Functions inherited from SMW\SQLStore\EntityStore\DataItemHandler
 __construct (SQLStore $store)
 
 getTableFields ()
 
 getFetchFields ()
 
 getTableIndexes ()
 
 getWhereConds (DataItem $dataItem)
 
 getInsertValues (DataItem $dataItem)
 
 getIndexField ()
 
 getLabelField ()
 
 dataItemFromDBKeys ($dbkeys)
 

Public Attributes

const MAX_HASH_LENGTH = 72
 

Static Protected Member Functions

static makeHash ($string)
 

Additional Inherited Members

- Protected Attributes inherited from SMW\SQLStore\EntityStore\DataItemHandler
 $store
 

Detailed Description

This class implements Store access to blob (string) data items.

GNU GPL v2+

Since
1.8
Author
Nischay Nahata

Member Function Documentation

SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::dataItemFromDBKeys (   $dbkeys)
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getFetchFields ( )
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getIndexField ( )
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getInsertValues ( DataItem  $dataItem)
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getLabelField ( )
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getTableFields ( )
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getTableIndexes ( )
Since
1.8
SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::getWhereConds ( DataItem  $dataItem)
Since
1.8
static SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::makeHash (   $string)
staticprotected

Method to make a hashed representation for strings of length greater than self::MAX_HASH_LENGTH to be used for selecting and sorting.

Since
1.8
Parameters
$stringstring
Returns
string

Member Data Documentation

const SMW\SQLStore\EntityStore\DIHandlers\DIBlobHandler::MAX_HASH_LENGTH = 72

Maximal number of bytes (chars) to be stored in the hash field of the table. Must not be bigger than 255 (the length of our VARCHAR field in the DB). Strings that are longer than this will be stored as a blob, and the hash will only start with the original string but the last 32 bytes are used for a hash. So the minimal portion of the string that is stored literally in the hash is 32 chars less.

The value of 72 was chosen since it leads to a smaller index size at the cost of needing more blobs in cases where many strings are of length 73 to 255. But keeping the index small seems more important than saving disk space. Also, with 72 bytes there are at least 40 bytes of content available for sorting and prefix matching, which should be more than enough in most contexts.

Since
1.8

The documentation for this class was generated from the following file: