> For the complete documentation index, see [llms.txt](https://docs.quanti.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quanti.io/key-concepts/fundamental-concepts/date-and-partitioning.md).

# Date & Partitioning

The **reference date** (or synchronization date) defines the **temporal scope** of each synchronization.

## How it works

Quanti processes queries and insertions **date by date**. For each synchronization, a reference date is defined (for example `2025-01-15`), and all data for that day is processed together.

## Practical example

If you synchronize advertising metrics for **January 15, 2025**:

* Reference date = `2025-01-15`
* All data for that day is retrieved from the source platform
* This data is then inserted into your data warehouse with this reference date

## Partitioning and optimization

On **fact tables (metrics)**, Quanti uses this reference date to partition tables via the `_quanti_date` field.

How does it work?

```
campaign_stats table partitioned on _quanti_date

Partition 2025-01-13: [data from 01/13]
Partition 2025-01-14: [data from 01/14]
Partition 2025-01-15: [data from 01/15]  ← only this partition is affected
Partition 2025-01-16: [data from 01/16]
```

During a synchronization for `2025-01-15`, only the corresponding partition is targeted:

* SQL queries scan **only the affected partition**
* Insert/delete operations are **isolated** to this partition
* Other partitions are neither read nor modified

{% hint style="success" %}
Partitioning by date via `_quanti_date` allows you to:

* **Optimize performance**: SQL queries scan only strictly necessary data + *with where quanti*\_date \[>= <=, <, > =} is used
* **Reduce costs**: less data scanned = reduced billing on your data warehouse
* **Speed up synchronizations**: operations are faster because targeted to a data subset
* **Facilitate maintenance**: ability to reprocess a specific day without impacting other dates
* **Determine the deletion scope** in certain insertion methods (REPLACE Mode): only data for this date is affected
  {% endhint %}

{% hint style="info" %}
Partitioning by `_quanti_date` is primarily used on **fact tables** (metrics, events) where the date notion is intrinsic to the data. **Dimension tables** (attributes) are generally not partitioned because they represent a global state rather than a time series.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quanti.io/key-concepts/fundamental-concepts/date-and-partitioning.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
