Skip to content

IN vs equals query. IN query much slower  #10618

@jamesryanbell

Description

@jamesryanbell

What happens?

When running a single item IN query the performance is considerably slower than the same as an = query.

To Reproduce

Populate database, in our case it's two columns, both varchar. The first column is a string ID, the second is a large block of text, 20K+ characters.

Run the first query, this should be instant.
SELECT * FROM table WHERE col1 = 'test';

Run the second query, this will take 15-30 minutes
SELECT * FROM table WHERE col1 IN ('test');

OS:

Windows, Linux

DuckDB Version:

v0.9.2 3c695d7

DuckDB Client:

CLI

Full Name:

James Bell

Affiliation:

The Data City

Have you tried this on the latest nightly build?

I have tested with a nightly build

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

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions