File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,22 @@ type DBHandler struct {
17
17
}
18
18
19
19
func (h * DBHandler ) initializeDB () error {
20
+
21
+ pragmas := []string {
22
+ "PRAGMA synchronous = OFF" , // Disable synchronous writes for faster performance
23
+ "PRAGMA journal_mode = WAL" , // Enable Write-Ahead Logging for better concurrency
24
+ "PRAGMA cache_size = -10000" , // Increase cache size to 10,000 pages (adjust as needed)
25
+ "PRAGMA mmap_size = 268435456" , // Enable memory-mapped I/O with 256 MB
26
+ "PRAGMA temp_store = MEMORY" , // Store temporary tables and indices in memory
27
+ "PRAGMA locking_mode = EXCLUSIVE" , // Use exclusive locking mode (since no concurrent writes)
28
+ }
29
+
30
+ for _ , pragma := range pragmas {
31
+ if _ , err := h .db .Exec (pragma ); err != nil {
32
+ return fmt .Errorf ("error executing PRAGMA %s: %v" , pragma , err )
33
+ }
34
+ }
35
+
20
36
queries := []string {
21
37
`CREATE TABLE IF NOT EXISTS articles (
22
38
id INTEGER PRIMARY KEY,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
"os"
11
11
)
12
12
13
- const Version = "0.0.34 "
13
+ const Version = "0.0.35 "
14
14
15
15
type Config struct {
16
16
importPath string //https://dumps.wikimedia.org/other/enterprise_html/runs/...
You can’t perform that action at this time.
0 commit comments