Sped up sqlite inserts 2x when built with persistent 2.14.5.0

https://github.com/yesodweb/persistent/issues/1457

Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
Joey Hess 2023-03-31 14:34:18 -04:00
parent a858099272
commit cc36c8516a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 52 additions and 9 deletions

View file

@ -21,6 +21,7 @@ module Database.Keys.SQL where
import Database.Types
import Database.Handle
import Database.Utility
import qualified Database.Queue as H
import Utility.InodeCache
import Git.FilePath
@ -121,7 +122,7 @@ removeAssociatedFile k f = queueDb $
addInodeCaches :: Key -> [InodeCache] -> WriteHandle -> IO ()
addInodeCaches k is = queueDb $
forM_ is $ \i -> insertUnique $ Content k i
forM_ is $ \i -> insertUniqueFast $ Content k i
(inodeCacheToFileSize i)
(inodeCacheToEpochTime i)