exec-ddl
CREATE TABLE a (k INT PRIMARY KEY, i INT, s STRING, d DECIMAL NOT NULL)
----
TABLE a
 ├── k int not null
 ├── i int
 ├── s string
 ├── d decimal not null
 └── INDEX primary
      └── k int not null

opt
SELECT k, s FROM a
----
scan a
 ├── columns: k:1(int!null) s:3(string)
 ├── stats: [rows=1000]
 ├── cost: 1060.02
 ├── key: (1)
 └── fd: (1)-->(3)

# Regression test for #35042. Ensure we always prefer constrained scans.
exec-ddl
CREATE TABLE speed_test (id INT PRIMARY KEY DEFAULT unique_rowid())
----
TABLE speed_test
 ├── id int not null
 └── INDEX primary
      └── id int not null

opt
SELECT id FROM speed_test@primary WHERE id BETWEEN 1 AND 1000 AND ((id % 16) = 0)
----
select
 ├── columns: id:1(int!null)
 ├── stats: [rows=333.333333, distinct(1)=333.333333, null(1)=0]
 ├── cost: 1030.02
 ├── key: (1)
 ├── scan speed_test
 │    ├── columns: id:1(int!null)
 │    ├── constraint: /1: [/1 - /1000]
 │    ├── flags: force-index=primary
 │    ├── stats: [rows=1000, distinct(1)=1000, null(1)=0]
 │    ├── cost: 1020.01
 │    └── key: (1)
 └── filters
      └── (id % 16) = 0 [type=bool, outer=(1)]

opt
SELECT id FROM speed_test@primary WHERE id BETWEEN 1 AND 2000 AND ((id % 16) = 0)
----
select
 ├── columns: id:1(int!null)
 ├── stats: [rows=333.333333, distinct(1)=333.333333, null(1)=0]
 ├── cost: 1030.02
 ├── key: (1)
 ├── scan speed_test
 │    ├── columns: id:1(int!null)
 │    ├── constraint: /1: [/1 - /2000]
 │    ├── flags: force-index=primary
 │    ├── stats: [rows=1000, distinct(1)=1000, null(1)=0]
 │    ├── cost: 1020.01
 │    └── key: (1)
 └── filters
      └── (id % 16) = 0 [type=bool, outer=(1)]
