message: Also verify that memory usage drops again
diff: # description: Test ART index with many matches
  # group: [art]
  +require noforcestorage
  +
  require skip_reload
  +statement ok
  +CREATE FUNCTION memory_usage_to_bytes(x) AS CASE
  + WHEN CONTAINS(x, 'KB') THEN REPLACE(x, 'KB', '')::INT * 1000
  + WHEN CONTAINS(x, 'MB') THEN REPLACE(x, 'MB', '')::INT * 1000 * 1000
  + WHEN CONTAINS(x, 'GB') THEN REPLACE(x, 'GB', '')::INT * 1000 * 1000 * 1000
  + WHEN CONTAINS(x, 'TB') THEN REPLACE(x, 'TB', '')::INT * 1000 * 1000 * 1000 * 1000
  + ELSE x::INT END
  +
  statement ok
  create table integers(i integer);
  @@ -11,11 +21,17 @@ statement ok
  insert into integers select * from range(1000000);
  statement ok
  -create temporary table base_memory as select replace(memory_usage, 'MB', '')::INT AS usage from pragma_database_size();
  +create temporary table base_memory as select memory_usage_to_bytes(memory_usage) AS usage from pragma_database_size();
  statement ok
  drop table integers
  +# verify that the memory dropped again
  +query I
  +SELECT memory_usage_to_bytes(current_usage.memory_usage) * 10 < base_memory.usage FROM pragma_database_size() current_usage, base_memory;
  +----
  +true
  +
  statement ok
  create table integers(i integer primary key);
  @@ -23,10 +39,18 @@ statement ok
  insert into integers select * from range(1000000);
  statement ok
  -create temporary table index_memory as select replace(memory_usage, 'MB', '')::INT AS usage from pragma_database_size();
  +create temporary table index_memory as select memory_usage_to_bytes(memory_usage) AS usage from pragma_database_size();
  query I
  SELECT index_memory.usage > 2 * base_memory.usage FROM base_memory, index_memory
  ----
  1
  +statement ok
  +DROP TABLE integers
  +
  +# verify that the memory dropped again
  +query I
  +SELECT memory_usage_to_bytes(current_usage.memory_usage) * 10 < base_memory.usage FROM pragma_database_size() current_usage, base_memory;
  +----
  +true
  