sql query use "in ..." is very slow
- Dominant language
- Java
- Stars
- 5.1k
- Forks
- 1.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 46
Description
this is query very slow,aboult 1s:
SELECT f1,f2,f3 FROM table_x WHERE f1IN (107,108) AND f2= 1 AND ydate = 20230616
this is query very fast,about 20ms:
SELECT f1,f2,f3 FROM table_x WHERE f1=107 AND f2= 1 AND ydate = 20230616
UNION ALL
SELECT f1,f2,f3 FROM table_x WHERE f1=108 AND f2 = 1 AND ydate = 20230616
this is why?
CREATE INDEX table_x_IDX ON PUBLIC.table_x (f1,f2 DESC,f3,f4);
Contributor guide
Research direction
The report names no source files, tests, or entry points; begin by reproducing the two SQL queries in Apache Ignite with the stated table and index. Compare execution plans and collect the schema, data distribution, and Ignite version, then document the cause of the performance difference and a verified fix or explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100