{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Data Workbench","type":"markdown"},"seo":{"title":"Data Partitioning in Treasure Data","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"data-partitioning-in-treasure-data","__idx":0},"children":["Data Partitioning in Treasure Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tables in Treasure Data are partitioned by the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]}," column by default."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When records are filtered by the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]}," column value, query engines process only relevant records instead of processing an entire data set."," ","This processing time data pruning allows efficient data processing."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the following examples, only records that fit the specified time range are selected."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"--example 1:\nSELECT  \n  ... \nWHERE \n  TD_TIME_RANGE(time,'2013-01-01', 'PDT', null);\n\n--example 2:\nSELECT \n  COUNT(1) \nFROM \n  table_name\nWHERE \n  TD_TIME_RANGE(time, '2017-07-01', '2017-07-02', 'UTC');\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The system dynamically merges or splits table partitions in the background to maintain optimal query performance and load balancing."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"user-defined-partitioning","__idx":1},"children":["User-Defined Partitioning"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["User-defined partitioning is an alternative to timestamp-based partitioning. User-defined partitioning allows other data partitioning strategies that can improve performance when working with non-time-series data. For more information, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/queries/trino/performance_tuning#defining-partitioning-for-trino"},"children":["Defining Partitioning for Trino"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For examples of how to use time-based partitioning in Treasure Data, refer to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/queries/trino/performance_tuning"},"children":["Performance Tuning"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/queries/trino/performance_tuning#leveraging-time-based-partitioning"},"children":["Leveraging Time-Based Partitioning"]}]}]}]},"headings":[{"value":"Data Partitioning in Treasure Data","id":"data-partitioning-in-treasure-data","depth":1},{"value":"User-Defined Partitioning","id":"user-defined-partitioning","depth":2}],"frontmatter":{"seo":{"title":"Data Partitioning in Treasure Data"}},"lastModified":"2026-01-29T02:26:20.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/data-workbench/queries/data-partitioning-in-treasure-data","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}