# Vector Functions Boost Query Performance & 8 New Contributors Join the Quest! | Greptime Biweekly Report

Source: https://greptime.com/blogs/2025-03-19-greptimedb-biweekly-report

## Summary

Together with our global community of contributors, GreptimeDB continues to evolve and flourish as a growing open-source project. We are grateful to each and every one of you.

Below are the highlights among recent commits:
- Added new data models for OpenTelemetry Trace.
- Added new vector functions, like `vec_subvector` and `vec_kth_elem`.
- The default `data_home` directory in the configuration has been changed from `/tmp` to the current folder.
- Supported new PromQL functions, `quantile`, c`ount_values`.
- The pipeline has also been improved with several enhancements:
  - Added support for setting `tags` in transformations.
  - Enabled `inverted index` configuration within the pipeline.
  - Introduced a `lightweight extract processor`.

## Contributors 

For the past two weeks, our community has been super active with a total of **94 PRs** merged. **12 PRs** from **8 individual contributors** merged successfully and lots pending to be merged.

Congrats on becoming our most active contributors in the past 2 weeks:

> - @*[AntiTopQuark](https://github.com/AntiTopQuark)* **[db#5623](https://github.com/GreptimeTeam/greptimedb/pull/5623)** 
> - @*[lau-jay](https://github.com/lau-jay)* **[docs#1579](https://github.com/GreptimeTeam/docs/pull/1579)**
> - @*[linyihai](https://github.com/linyihai)* **[db#5616](https://github.com/GreptimeTeam/greptimedb/pull/5616) [docs#1544](https://github.com/GreptimeTeam/docs/pull/1544)**
> - @*[Pikady](https://github.com/Pikady)* **[db#5674](https://github.com/GreptimeTeam/greptimedb/pull/5674)**  
> - @*[SNC123](https://github.com/SNC123)* **[db#5683](https://github.com/GreptimeTeam/greptimedb/pull/5683)** 
> - @*[Wenbin1002](https://github.com/Wenbin1002)* **[db#5728](https://github.com/GreptimeTeam/greptimedb/pull/5728)** 
> - @*[wtzhang23](https://github.com/wtzhang23)* **[promql-parser#105](https://github.com/GreptimeTeam/promql-parser/commit/700ea041d494464ca0c81e4f72b2d8b5920e3e07)**
> - @*[yihong0618](https://github.com/yihong0618)* **[db#5715](https://github.com/GreptimeTeam/greptimedb/pull/5715) [db#5706](https://github.com/GreptimeTeam/greptimedb/pull/5706) [db#5657](https://github.com/GreptimeTeam/greptimedb/pull/5657) [db#5585](https://github.com/GreptimeTeam/greptimedb/pull/5585)**

👏 Welcome @[lau-jay](https://github.com/lau-jay) @[Pikady](https://github.com/Pikady) @[SNC123](https://github.com/SNC123) @[Wenbin1002](https://github.com/Wenbin1002) @[wtzhang23](https://github.com/wtzhang23) to the community as a new contributor with a successfully merged PR, and more PRs from other individual contributors are waiting to be merged.

<figure>
<img src="/blogs/2025-03-19-greptimedb-biweekly-report/contributorimage.png" alt="New Contributors of GreptimeDB" style="width: 70%; margin: 0 auto">
<figcaption>New Contributors of GreptimeDB</figcaption>
</figure>

🎉 A big THANK YOU to all our members and contributors! It is people like you who are making GreptimeDB a great product. Let's build an even greater community together.

## Highlights of Recent PRs

### [db#5622 OpenTelemetry Trace Data Modeling Enhancement](https://github.com/GreptimeTeam/greptimedb/pull/5622)

GreptimeDB introduces a refined data modeling approach for OpenTelemetry traces, optimizing observability and query performance. Key updates include:
- Built-in Pipeline: A new `greptime_trace_v1` pipeline is introduced.
- Expanded Attributes: Attributes are now expanded into dedicated columns by default.
- Skipping Index: Added to `trace_id`, `parent_span_id`, and `span_name` for both `greptime_trace_v1` and `v0`, improving query efficiency.
- Partitioning Strategy: Default partitioning rules are applied to `trace_id` in `greptime_trace_v1` and `v0` to enhance data organization and retrieval.

### [db#5683 New Vector Functions: `vec_subvector`](https://github.com/GreptimeTeam/greptimedb/pull/5683)

The newly added `vec_subvector(vec, start, end)` function extracts a subvector from the given `start` (inclusive) to `end` (exclusive) index, facilitating efficient vector slicing. Example Query:

```sql
SELECT vec_to_string(vec_subvector("[1, 2, 3, 4, 5]", 1, 3)) AS result;
```

Output:

```sql
+--------+
| result |
+--------+
| [2,3]  |
+--------+
```

### [db#5674 Add `vec_kth_elem` function](https://github.com/GreptimeTeam/greptimedb/pull/5674)

The `vec_kth_elem(vec, k)` function retrieves the `k-th` element from a given vector, simplifying element access. Example Query:

```sql
SELECT vec_kth_elem("[2, 4, 6]",1) as result;
```

Output:

```sql
+---------+
| result  |
+---------+
| 4       |
+---------+
```

## Good First Issue

### [db#5120 Add vector functions JSON_TO_VEC, VEC_TO_JSON](https://github.com/GreptimeTeam/greptimedb/pull/5120)

`JSON_TO_VEC`: Convert a JSON array to a vector. 
`VEC_TO_JSON`: Convert a vector to a JSON array. 

- Difficulty: Medium 
- Keywords: vector

---
#### About Greptime

Greptime offers industry-leading time series database products and solutions to empower IoT and Observability scenarios, enabling enterprises to uncover valuable insights from their data with less time, complexity, and cost.

[GreptimeDB](https://github.com/GreptimeTeam/greptimedb) is an open-source, high-performance time-series database offering unified storage and analysis for metrics, logs, and events. Try it out instantly with [GreptimeCloud](https://www.greptime.com/product/cloud), a fully-managed DBaaS solution—no deployment needed!

The [Edge-Cloud Integrated Solution](https://greptime.com/product/carcloud) combines multimodal edge databases with cloud-based GreptimeDB to optimize IoT edge scenarios, cutting costs while boosting data performance.

Star us on [GitHub](https://github.com/GreptimeTeam/greptimedb) or join GreptimeDB Community on [Slack](https://www.greptime.com/slack) to get connected.
