| 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 |
column_create Users secret COLUMN_SCALAR ShortText |
| 6 |
|
| 7 |
# The 'secret' column stores large strings over 65536B, which are `SEQUENTIAL` |
| 8 |
# elements and are stored in `SEQUENTIAL` segments. These segments will be |
| 9 |
# defragmentation targets. |
| 10 |
#@disable-logging |
| 11 |
#@generate-series 1 4 Users '{"_key" => "user-no-#{i}", "secret" => "#{"x" * (2 ** 20)}"}' |
| 12 |
#@enable-logging |
| 13 |
|
| 14 |
delete Users --filter '_id == 2' |
| 15 |
|
| 16 |
# After defragmentation, the `curr_key` of the PAT keys should decrease. |
| 17 |
# Additionally, defragmentation logs for the variable-size column should be |
| 18 |
# displayed. |
| 19 |
check Users |
| 20 |
defrag Users |
| 21 |
check Users |