File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -172,19 +172,27 @@ module Status
172
172
end
173
173
174
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.
175
+ # Debugging mode. Do not actually perform any optimizations but instead return one line of
176
+ # text for each optimization that would have been done. Off by default .
177
177
DEBUG = 0x00001
178
178
179
- # Run ANALYZE on tables that might benefit.
179
+ # Run ANALYZE on tables that might benefit. On by default.
180
180
ANALYZE_TABLES = 0x00002
181
181
182
- # When running ANALYZE, set a temporary PRAGMA analysis_limit to prevent excess run-time.
182
+ # When running ANALYZE, set a temporary PRAGMA analysis_limit to prevent excess run-time. On
183
+ # by default.
183
184
LIMIT_ANALYZE = 0x00010
184
185
185
186
# 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
+ # any have grown and shrunk significantly and hence might benefit from being re-analyzed. Off
188
+ # by default.
187
189
CHECK_ALL_TABLES = 0x10000
190
+
191
+ # Useful for adding a bit to the default behavior, for example
192
+ #
193
+ # db.optimize(Optimize::DEFAULT | Optimize::CHECK_ALL_TABLES)
194
+ #
195
+ DEFAULT = ANALYZE_TABLES | LIMIT_ANALYZE
188
196
end
189
197
end
190
198
end
Original file line number Diff line number Diff line change @@ -342,6 +342,8 @@ def mmap_size=(size)
342
342
#
343
343
# To customize the optimization options, pass +bitmask+ with a combination
344
344
# of the Constants::Optimize masks.
345
+ #
346
+ # See https://www.sqlite.org/pragma.html#pragma_optimize for more information.
345
347
def optimize ( bitmask = nil )
346
348
if bitmask
347
349
set_int_pragma "optimize" , bitmask
You can’t perform that action at this time.
0 commit comments