# lttb — Haybarn WASM 2.0.0-rc12

Downsamples the (x, y) points to (at most) n representative points using the Largest Triangle Three Buckets algorithm. Returns a LIST of STRUCT(x, y); the points must be ordered by x (use lttb(x, y, n ORDER BY x)).

- Reference: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/
- JSON: /products/haybarn/functions/api/v1/haybarn-2.0.0-rc12/functions/lttb.json
- Snapshot ID: haybarn-2.0.0-rc12
- Engine: haybarn v2.0.0
- Source ID: 9b1a0c5829
- Binary SHA-256: 07ab540b40e7dded86546a179f58276085900a44e92d1aa070072360c1f78ae6
- Captured: 2026-11-06T18:33:13.228Z
- Source: https://www.npmjs.com/package/@haybarn/haybarn-wasm/v/2.0.0-rc12
- Loaded extensions: core_functions, icu, json, nanoarrow, parquet

## Interpretation

- Choose a snapshot matching the target engine and build. The default is captured from the published Haybarn WASM package used by the browser playground. Historical native snapshots are also available.
- Availability is an observation in the recorded build and extension profile, not a guarantee of support in every installation or in WASM.
- Types and descriptions are declarations from duckdb_functions(). Binding can specialize result types. Null means not supplied by the catalog; do not invent defaults, optionality, argument mode, or table output columns.
- Raw parameter arrays preserve catalog order for scalar/aggregate/macro functions. Raw table arguments are alphabetical. Use callingConvention for engine-confirmed positional order and named arguments; null modes are unrecorded. Named does not mean optional. Macro defaults and special named variadic behavior are not supplied by duckdb_functions().
- Catalog examples are source material and may require data or extensions. runnableExamples contains separately verified SQL for the pinned WASM package; sample-data adaptations and guide examples are labeled separately.
- Guide annotations and recipes are separate editorial content. The browser runner always uses Haybarn WASM 2.0.0-rc12, independently of the documentation snapshot.
- All URLs beginning with / are relative to the origin hosting this document. Exports require no JavaScript, cookies, API key, or browser engine.

## Overloads

### overload-e66a60740bb8454e

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: DOUBLE, y: DOUBLE, n: BIGINT) → STRUCT(x DOUBLE, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-e66a60740bb8454e

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DOUBLE | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x DOUBLE, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-b07f7765b125361d

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: DOUBLE, y: FLOAT, n: BIGINT) → STRUCT(x DOUBLE, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-b07f7765b125361d

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | DOUBLE | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x DOUBLE, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-510773ee735ad43b

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: FLOAT, y: DOUBLE, n: BIGINT) → STRUCT(x FLOAT, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-510773ee735ad43b

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | FLOAT | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x FLOAT, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-6c8724a23c70b5a2

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: FLOAT, y: FLOAT, n: BIGINT) → STRUCT(x FLOAT, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-6c8724a23c70b5a2

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | FLOAT | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x FLOAT, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-adc91a4366c0ca98

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP WITH TIME ZONE, y: DOUBLE, n: BIGINT) → STRUCT(x TIMESTAMP WITH TIME ZONE, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-adc91a4366c0ca98

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP WITH TIME ZONE | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP WITH TIME ZONE, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-404ea6d2e65bb155

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP WITH TIME ZONE, y: FLOAT, n: BIGINT) → STRUCT(x TIMESTAMP WITH TIME ZONE, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-404ea6d2e65bb155

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP WITH TIME ZONE | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP WITH TIME ZONE, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-ed438b0c3e13bd95

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP_MS, y: DOUBLE, n: BIGINT) → STRUCT(x TIMESTAMP_MS, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-ed438b0c3e13bd95

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP_MS | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP_MS, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-bd56d9fe148e92f9

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP_MS, y: FLOAT, n: BIGINT) → STRUCT(x TIMESTAMP_MS, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-bd56d9fe148e92f9

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP_MS | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP_MS, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-f5c4446970ee4a1e

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP_NS, y: DOUBLE, n: BIGINT) → STRUCT(x TIMESTAMP_NS, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-f5c4446970ee4a1e

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP_NS | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP_NS, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-d5851e09c2597d01

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP_NS, y: FLOAT, n: BIGINT) → STRUCT(x TIMESTAMP_NS, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-d5851e09c2597d01

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP_NS | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP_NS, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-ca95237440f318f4

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP_S, y: DOUBLE, n: BIGINT) → STRUCT(x TIMESTAMP_S, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-ca95237440f318f4

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP_S | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP_S, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-ca507f22b1736caf

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP_S, y: FLOAT, n: BIGINT) → STRUCT(x TIMESTAMP_S, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-ca507f22b1736caf

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP_S | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP_S, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-e236449b8d39d075

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP, y: DOUBLE, n: BIGINT) → STRUCT(x TIMESTAMP, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-e236449b8d39d075

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-88b36f35c330632d

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMP, y: FLOAT, n: BIGINT) → STRUCT(x TIMESTAMP, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-88b36f35c330632d

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMP | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMP, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-2ca12273e41acd30

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMPTZ_NS, y: DOUBLE, n: BIGINT) → STRUCT(x TIMESTAMPTZ_NS, y DOUBLE)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-2ca12273e41acd30

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMPTZ_NS | not recorded |
| y | DOUBLE | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMPTZ_NS, y DOUBLE)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.

### overload-ef3a55c355fdc012

Kind: aggregate. Parameter order: catalog-order.

```text
lttb(x: TIMESTAMPTZ_NS, y: FLOAT, n: BIGINT) → STRUCT(x TIMESTAMPTZ_NS, y FLOAT)[]
```

Link: /products/haybarn/functions/releases/haybarn-2.0.0-rc12/lttb/#overload-ef3a55c355fdc012

| Argument | Catalog type | Calling mode |
| --- | --- | --- |
| x | TIMESTAMPTZ_NS | not recorded |
| y | FLOAT | not recorded |
| n | BIGINT | not recorded |

Declared return type: STRUCT(x TIMESTAMPTZ_NS, y FLOAT)[]. Variadic argument type: none declared.
Stability: CONSISTENT. Declared side effects: false.


## Guide recipes

No guide recipes.

## Engine catalog examples

Source examples may require additional data or extensions. Expressions are wrapped in SELECT; execution verification is not recorded.

Reported for: overload-e66a60740bb8454e, overload-b07f7765b125361d, overload-510773ee735ad43b, overload-6c8724a23c70b5a2, overload-adc91a4366c0ca98, overload-404ea6d2e65bb155, overload-ed438b0c3e13bd95, overload-bd56d9fe148e92f9, overload-f5c4446970ee4a1e, overload-d5851e09c2597d01, overload-ca95237440f318f4, overload-ca507f22b1736caf, overload-e236449b8d39d075, overload-88b36f35c330632d, overload-2ca12273e41acd30, overload-ef3a55c355fdc012

```sql
SELECT lttb(x, y, 500 ORDER BY x);
```

## Runnable examples

Executed successfully in Haybarn WASM 2.0.0-rc12. Sample data and guide examples are separate from the original catalog.

```sql
SELECT lttb(x, y, 500 ORDER BY x)
FROM (VALUES
  (10, 10),
  (20, 20),
  (NULL, NULL)
) AS sample("x", "y");
```

## Additional DuckDB documentation

- [Aggregate Functions](https://duckdb.org/docs/current/sql/functions/aggregates)

## Observed availability

| Snapshot | Observed | Overloads | JSON |
| --- | --- | --- | --- |
| haybarn-2.0.0-rc12 | present | 16 | [reference](/products/haybarn/functions/api/v1/haybarn-2.0.0-rc12/functions/lttb.json) |
| haybarn-2.0.0-rc11 | present | 16 | [reference](/products/haybarn/functions/api/v1/haybarn-2.0.0-rc11/functions/lttb.json) |
| haybarn-2.0.0-rc8 | present | 16 | [reference](/products/haybarn/functions/api/v1/haybarn-2.0.0-rc8/functions/lttb.json) |
| haybarn-1.5.5-rc3 | not observed | 0 | — |
| haybarn-1.5.6-rc6 | not observed | 0 | — |
| duckdb-2.0.0 | present | 16 | [reference](/products/haybarn/functions/api/v1/duckdb-2.0.0/functions/lttb.json) |
| duckdb-1.5.6 | not observed | 0 | — |
| duckdb-1.5.5 | not observed | 0 | — |
| duckdb-1.4.4 | not observed | 0 | — |
| duckdb-1.3.2 | not observed | 0 | — |

Engine catalog documentation is derived from MIT-licensed Haybarn and DuckDB. [Notices](/third-party-notices.txt).
