File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -170,5 +170,21 @@ module Status
170
170
# This parameter records the number of separate memory allocations currently checked out.
171
171
MALLOC_COUNT = 9
172
172
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
173
189
end
174
190
end
Original file line number Diff line number Diff line change @@ -338,6 +338,10 @@ def mmap_size=(size)
338
338
set_int_pragma "mmap_size" , size
339
339
end
340
340
341
+ # Attempt to optimize the database.
342
+ #
343
+ # To customize the optimization options, pass +bitmask+ with a combination
344
+ # of the Constants::Optimize masks.
341
345
def optimize ( bitmask = nil )
342
346
if bitmask
343
347
set_int_pragma "optimize" , bitmask
You can’t perform that action at this time.
0 commit comments