Skip to content
  • shess's avatar
    [sql] Consider fresh databases suitable for memory-mapped I/O. · 9bf2c674
    shess authored
    GetAppropriateMmapSize() is called to validate the database as
    error-free before enabling memory-mapped mode.  The validation status is
    stored in the [meta] table, since new databases have no [meta] table it
    previously defaulted to not turning on memory-mapping.  Then on second
    open the file would be validated.
    
    This change uses the lack of [meta] table as a signal that the file is
    new and should be safe to memory-map.  Additionally the code creating
    [meta] pre-populates that setting.
    
    Additionally disable memory-mapped mode for databases which do not make
    use of the [meta] table.  This makes the existing settings explicit.
    
    BUG=537742, 555578
    TBR=rdevlin.cronin@chromium.org, michaeln@chromium.org, zea@chromium.org, sky@chromium.org
    
    Review URL: https://codereview.chromium.org/1533703002
    
    Cr-Commit-Position: refs/heads/master@{#365959}
    9bf2c674