Skip to content

Enums functionality fails when memory limit is low #5983

@Tmonster

Description

@Tmonster

What happens?

Converting a table with varchar columns to a table with enum columns increases the size of a duckdb database by more than double. The operation does not complete either. This happens when the size of the database is close to the memory limit of the duckdb persistent session.

To Reproduce

./build/debug/duckdb mem_limit_enum.duckdb
set memory_limit='2GB';
load tpch;
call dbgen(sf=2);
SELECT count(distinct(l_comment)) from lineitem;
CREATE TYPE l_comment_enum as ENUM(select l_comment from lineitem); # statement 1
CREATE TABLE lineitem2 (comment l_comment_enum); # statement 2

After statement 2, the creation of the table increases the size of the database by over 50%.
You can keep creating tables to show this

INSERT INTO lineitem2 (select l_comment from lineitem);

Observe as the size of mem_limit_enum.duckdb increases to over 5GB and the insert statement does not complete.

OS:

MacOs Monterey

DuckDB Version:

v0.6.2-dev1218

DuckDB Client:

CLI

Full Name:

Tom Ebergen

Affiliation:

DuckDB labs

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions