Commit 874e10e
committed
Improve cursor window performance, allow user to override window size
The JNI CursorWindow will allocate 1 MB of storage for mapping results. Under
the new default behavior, the CursorWindow will grow in size incrementally by
1 MB chunks as needed. This behavior allows for retrieving results of an
unknown size.
Alternatively, some queries may perform better with a fixed allocation of
storage. This will limit the total cursor window storage to a fixed size,
constraining the size of the fields mapped into the backing store. This causes
the cursor window to behave as a viewport into the underlying resultset, only
mapping a segement (as defined by the storage size) into memory at a given time.
To do so, the user can specify the window size prior to performing the query
as such:
long size = 1024 * 1024 * 4;
CursorWindow.setCursorWindowAllocation(new FixedCursorWindowAllocation(size));1 parent 5f04b6f commit 874e10e
File tree
7 files changed
+79
-51
lines changed- android-database-sqlcipher/src/main
- cpp
- java/net/sqlcipher
7 files changed
+79
-51
lines changedLines changed: 17 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 44 | | |
61 | 45 | | |
62 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
63 | 50 | | |
64 | 51 | | |
65 | 52 | | |
66 | | - | |
| 53 | + | |
67 | 54 | | |
68 | | - | |
| 55 | + | |
| 56 | + | |
69 | 57 | | |
70 | 58 | | |
71 | 59 | | |
| |||
141 | 129 | | |
142 | 130 | | |
143 | 131 | | |
144 | | - | |
| 132 | + | |
145 | 133 | | |
| 134 | + | |
146 | 135 | | |
147 | 136 | | |
148 | 137 | | |
149 | 138 | | |
150 | 139 | | |
151 | 140 | | |
152 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
153 | 145 | | |
154 | 146 | | |
155 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 33 | | |
40 | 34 | | |
41 | 35 | | |
42 | 36 | | |
43 | 37 | | |
44 | | - | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
| |||
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
61 | | - | |
| 54 | + | |
| 55 | + | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
104 | 98 | | |
105 | 99 | | |
106 | 100 | | |
107 | | - | |
| 101 | + | |
108 | 102 | | |
109 | | - | |
110 | 103 | | |
111 | 104 | | |
112 | 105 | | |
113 | | - | |
114 | | - | |
115 | 106 | | |
116 | 107 | | |
117 | 108 | | |
| |||
192 | 183 | | |
193 | 184 | | |
194 | 185 | | |
195 | | - | |
| 186 | + | |
| 187 | + | |
196 | 188 | | |
197 | | - | |
198 | | - | |
199 | 189 | | |
200 | 190 | | |
201 | 191 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
619 | | - | |
| 620 | + | |
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
| |||
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
| |||
620 | 635 | | |
621 | 636 | | |
622 | 637 | | |
623 | | - | |
| 638 | + | |
624 | 639 | | |
625 | 640 | | |
626 | 641 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments