Debian Codegraph @

test/command/suite/defrag/pat/multiple_segments/use_full_segment.test

raw
1 # This is too slow with HTTP chunked.
2 #@require-interface stdio
3
4 table_create --name Users --flags TABLE_PAT_KEY --key_type ShortText
5
6 ### Test when the segment is stored in full.
7
8 # About data to load.
9 # 4,194,304 bytes per segment.
10 # 16 bytes per key.
11 # 4,194,304 / 16 = 262,144.
12 # This is data that uses the full segment.
13
14 #@timeout 120
15 #@disable-logging
16 #@generate-series 1 262144 Users '{"_key" => "User%012d" % i}'
17 # The following two data are immediate:true.
18 load --table Users
19 [
20 {"_key":"Jeff"},
21 {"_key":"John"}
22 ]
23 #@generate-series 262145 500000 Users '{"_key" => "User%012d" % i}'
24 # The following two data are immediate:true.
25 load --table Users
26 [
27 {"_key":"Joi"},
28 {"_key":"Jay"}
29 ]
30 #@enable-logging
31 #@timeout default
32
33 # Delete data in multiple segments so that fragmentation occurs in multiple segments.
34 delete Users --filter '_key == "User000000000100"'
35 delete Users --filter '_key == "User000000300000"'
36
37 object_inspect Users
38 defrag
39 object_inspect Users
40
41 # Last record of the first segment.
42 select Users --filter '_key == "User000000262145"'
43 # First record of the next segment.
44 select Users --filter '_key == "User000000262146"'