Loading TOC...

MarkLogic 12 EA 2 Product Documentation
admin:database-set-large-size-threshold

admin:database-set-large-size-threshold(
   $config as element(configuration),
   $database-id as xs:unsignedLong,
   $value as xs:unsignedInt
) as element(configuration)

Summary

This function sets the threshold at which binary documents in the specified database should be handled as binary large objects (BLOBs). Binary documents less than or equal to the threshold are treated as small binary objects, stored in stands. Binary documents larger than the threshold are stored in the Large Data Directory for more efficient memory consumption.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
database-id The ID of the database (for example, xdmp:database("myDatabase") ).
value The size in kilobytes beyond which binary documents are treated as binary large objects (BLOBs) and stored in the Large Data Directory. The default is 1 MB.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/database

http://marklogic.com/xdmp/privileges/admin/database/{id}

http://marklogic.com/xdmp/privileges/admin/database/index

http://marklogic.com/xdmp/privileges/admin/database/index/{id}

Usage Notes

Binary documents with size less than or equal to the configured threshold are treated as small binary objects and stored in stands. The entire contents of a small binary document is cached in memory. Binary documents larger than the threshold are stored in the Large Data Directory for more efficient memory usage. For details about small vs. large binaries, see "Binary Format" in the Application Developer's Guide.

The threshold value is in kilobytes and must be in the range:

The location of the Large Data Directory may be configured during forest creation by setting the "large data directory" property on the Forest configuration page of the Admin Interface, or by passing a large-data-directory parameter to admin:forest-create.

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

  let $config := admin:get-configuration()
  return
  admin:database-set-large-size-threshold($config, xdmp:database("myDatabase"),
      2048)

  (: returns the new configuration element -- use admin:save-configuration
     to save the changes to the configuration or pass the configuration
     to other Admin API functions to make other changes.  :)
      

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.