File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,5 +170,21 @@ module Status
170170 # This parameter records the number of separate memory allocations currently checked out.
171171 MALLOC_COUNT = 9
172172 end
173+
174+ module Optimize
175+ # Debugging mode. Do not actually perform any optimizations but instead return one line of text
176+ # for each optimization that would have been done.
177+ DEBUG = 0x00001
178+
179+ # Run ANALYZE on tables that might benefit.
180+ ANALYZE_TABLES = 0x00002
181+
182+ # When running ANALYZE, set a temporary PRAGMA analysis_limit to prevent excess run-time.
183+ LIMIT_ANALYZE = 0x00010
184+
185+ # Check the size of all tables, not just tables that have not been recently used, to see if
186+ # any have grown and shrunk significantly and hence might benefit from being re-analyzed.
187+ CHECK_ALL_TABLES = 0x10000
188+ end
173189 end
174190end
Original file line number Diff line number Diff line change @@ -338,6 +338,10 @@ def mmap_size=(size)
338338 set_int_pragma "mmap_size" , size
339339 end
340340
341+ # Attempt to optimize the database.
342+ #
343+ # To customize the optimization options, pass +bitmask+ with a combination
344+ # of the Constants::Optimize masks.
341345 def optimize ( bitmask = nil )
342346 if bitmask
343347 set_int_pragma "optimize" , bitmask
You can’t perform that action at this time.
0 commit comments