TimescaleDB v2.9 Documentation
首页 白天 夜间 BookChat 小程序 小程序 下载 阅读记录
  • 书签 我的书签
  • 添加书签 添加书签 移除书签 移除书签

Query data

来源 TimescaleDB 浏览 2 扫码 打印 2026-10-31 01:41:05
  • Querying data

Querying data

TimescaleDB hypertables are PostgreSQL tables. That means you can query them with standard SQL commands. In addition, you get extra benefits from TimescaleDB architecture and query planning.

  • About querying data
  • Select data with SELECT
  • Get faster DISTINCT queries with SkipScan
  • Perform advanced analytic queries
上一篇:
下一篇:
  • 书签
  • 添加书签 移除书签
  • Install TimescaleDB
    • Timescale Cloud
    • Self hosted
      • Debian/Ubuntu
      • RHEL/CentOS
      • Arch Linux
      • Windows
      • MacOS
      • From source
    • Pre-built containers
    • Kubernetes
    • Pre-built cloud images
    • Managed Service for TimescaleDB
    • Troubleshooting
  • Getting started
    • Create a hypertable
    • Add time-series data
    • Query your data
    • Create a continuous aggregate
      • Continuous aggregate basics
      • Continuous aggregate policies and refreshing data
    • Save space with compression
    • Learn about data retention
    • Next steps
  • TimescaleDB
    • Overview
      • What is time-series data?
      • Core concepts
        • Hypertables and chunks
          • Benefits of hypertables
          • Hypertable architecture
        • Scaling
        • Distributed hypertables
        • Compression
          • Compression architecture
        • Continuous aggregates
        • Data retention
        • User-defined actions
        • Backup and restore
      • Deployment options
      • TimescaleDB on Kubernetes
      • Data model flexibility
      • How does it compare?
        • Comparison with PostgreSQL
        • Comparison with NoSQL
      • Release notes
        • Changes in TimescaleDB 2.0
      • Limitations
      • FAQs
        • FAQs: Products
        • FAQs: Time-series databases
        • FAQs: Using TimescaleDB
        • FAQs: PostgreSQL
        • FAQs: Community
    • How-to Guides
      • Connecting to TimescaleDB
        • About connecting to TimescaleDB
        • About psql
        • Install psql
        • Connect using Azure Data Studio
        • Connect using DBeaver
        • Install pgAdmin
      • Hypertables
        • About hypertables
        • Create hypertables
        • Change hypertable chunk intervals
        • Alter hypertables
        • Create unique indexes on hypertables
        • Drop hypertables
        • Troubleshoot hypertables
      • Distributed hypertables
        • About distributed hypertables
        • Create distributed hypertables
        • Insert data
        • Query data
        • Alter and drop distributed hypertables
        • Create foreign keys on distributed hypertables
        • Use triggers in distributed hypertables
        • Troubleshooting
      • Time buckets
        • About time buckets
        • Use time buckets to group time-series data
      • Write data
        • About writing data
        • Insert data
        • Update data
        • Upsert data
        • Delete data
      • Data migration
        • About data migration
        • Migrate from the same database
        • Migrate from a different database
        • Import from CSV
        • Migrate InfluxDB data
        • Troubleshoot data migration
      • Ingest data from other sources
        • About ingesting data from other sources
        • Ingesting data with Prometheus
        • Ingesting data with Kafka
        • Ingesting data with Telegraf
        • Ingesting data with TimescaleDB parallel copy
      • Query data
        • About querying data
        • SELECT data
        • Perform DISTINCT queries with SkipScan
        • Perform advanced analytic queries
        • Troubleshooting
      • Configuration
        • About Configuration
        • Using timescaledb-tune
        • Manual PostgreSQL configuration
        • TimescaleDB configuration
        • Docker configuration
        • Telemetry
        • Troubleshooting
      • Schema management
        • About schemas
        • About indexing
        • About tablespaces
        • About constraints
        • Alter hypertables
        • Index
        • Triggers
        • JSON
        • Manage storage using tablespaces
      • Compression
        • About compression
        • Manually compress chunks
        • Decompress chunks
        • Backfill historical data
        • Modify a schema
        • Troubleshooting
      • Data retention
        • About data retention
        • About data retention with continuous aggregates
        • Create a retention policy
        • Manually drop chunks
        • Troubleshooting data retention
      • Continuous aggregates
        • About continuous aggregates
        • Create a continuous aggregate
        • Refresh policies for continuous aggregates
        • Create an index on a continuous aggregate
        • Time in continuous aggregates
        • Drop data from continuous aggregates
        • Manage materialized hypertables
        • Real time aggregates
        • Compress continuous aggregates
        • Migrate a continuous aggregate to the new form
        • Troubleshoot continuous aggregates
      • User-defined actions
        • About user-defined actions
        • Create and register a user-defined action
        • Test and debug a user-defined action
        • Alter and delete a user-defined action
        • Use an action for generic retention
        • Use an action for tablespace management
        • Use an action for downsampling and compression
        • Use an action to backfill data periodically
        • Troubleshooting
      • Alerting
      • Backup and restore
        • Using pg_dump/pg_restore
        • Docker & WAL-E
        • Physical backups
        • Troubleshooting
      • Upgrade TimescaleDB
        • About upgrades
        • Minor upgrades
        • Major upgrades
        • Downgrade TimescaleDB
        • Upgrade within Docker
        • Upgrade PostgreSQL
        • Troubleshooting upgrades
      • Hyperfunctions
        • About hyperfunctions
        • Install and update TimescaleDB Toolkit
        • Function pipelines
        • Approximate count distincts
          • Hyperloglog
        • Statistical aggregates
        • Gapfilling and interpolation
          • Time bucket gapfill
          • Last observation carried forward
        • Percentile approximation
          • Approximate percentile
          • Advanced aggregation methods
        • Counter aggregation
          • Counter aggregates
        • Time-weighted averages
          • Time-weighted averages
        • Troubleshoot hyperfunctions
      • Multi-node
        • About multi-node
        • Multi-node setup on TimescaleDB
        • Multi-node authentication
        • Configure multi-node
        • Multi-node administration
        • Grow and shrink a multi-node cluster
        • High availability multi-node
        • Multi-node maintenance
      • Replication and High Availability
        • About high availability
        • Configure replication
      • Additional tooling
        • About timescaledb-tune
        • Install and use timescaledb-parallel-copy
      • Uninstall TimescaleDB
        • Uninstall TimescaleDB on macOS
      • Troubleshoot TimescaleDB
    • Tutorials
      • Introduction to time-series data
        • Time-series tutorial - set up
        • Time-series tutorial - query data
        • Time-series tutorial - advanced queries
      • Introduction to time-series forecasting
      • Analyze cryptocurrency data
      • Analyze the Bitcoin blockchain
        • Ingest and query Bitcoin transactions
        • Analyze the blockchain with hyperfunctions
      • Store financial tick data in TimescaleDB
        • Design schema and ingest tick data
        • Create candlestick aggregates
        • Query the candlestick views
        • Advanced data management
      • Ingest real-time financial websocket data
      • Analyze NFT sales data
        • NFT schema design and ingestion
        • Analyzing NFT transactions
      • Analyze intraday stock data
        • Design database schema
        • Fetch and ingest stock data
        • Explore stock market data
      • Analyze data using hyperfunctions
        • Ingest and query data
        • Analyze data using SQL and hyperfunctions
        • Join time-series and relational data
        • Visualize time-series data
      • Monitor MST with Prometheus
      • Monitor a Django application with Prometheus
      • Collect metrics with Telegraf
      • Grafana
        • Connect TimescaleDB and Grafana
        • Setup Grafana on Managed Service for TimescaleDB
        • Create a dashboard and panel
        • Build Geospatial dashboards
        • Use Grafana variables
        • Visualize missing data
        • Setup alerts
        • Visualizations
          • Time-series
          • Histograms
          • Candlestick
          • Bar chart
          • Pie chart
      • Visualize data in Tableau
      • Custom TimescaleDB dashboards
      • Simulate IoT sensor data
      • TimescaleDB with AWS Lambda
        • Create a data API for TimescaleDB
        • Pull and ingest data from a third party API
        • Continuous deployment with GitHub actions
      • Sample datasets
    • Code quick starts
      • Node.js
      • Python
      • Ruby
      • Golang
      • Java
      • C# .Net
    • Contribute to TimescaleDB
    • Contribute to documentation
    • Compare TimescaleDB Editions
  • API Reference
    • Hypertables & chunks
      • create_hypertable
      • show_chunks
      • drop_chunks
      • reorder_chunk
      • move_chunk
      • add_reorder_policy
      • remove_reorder_policy
      • attach_tablespace
      • detach_tablespace
      • detach_tablespaces
      • show_tablespaces
      • set_chunk_time_interval
      • set_integer_now_func
      • add_dimension
      • create_index (transaction per chunk)
      • hypertable_size
      • hypertable_detailed_size
      • hypertable_index_size
      • chunks_detailed_size
    • Distributed hypertables
      • create_distributed_hypertable
      • add_data_node
      • attach_data_node
      • detach_data_node
      • delete_data_node
      • distributed_exec
      • set_number_partitions
      • set_replication_factor
      • copy_chunk
      • move_chunk
      • cleanup_copy_chunk_operation
      • create_distributed_restore_point
    • Compression
      • ALTER TABLE (Compression)
      • add_compression_policy
      • remove_compression_policy
      • compress_chunk
      • decompress_chunk
      • recompress_chunk
      • hypertable_compression_stats
      • chunk_compression_stats
    • Continuous aggregates
      • CREATE MATERIALIZED VIEW (Continuous Aggregate)
      • ALTER MATERIALIZED VIEW (Continuous Aggregate)
      • DROP MATERIALIZED VIEW (Continuous Aggregate)
      • refresh_continuous_aggregate
      • add_continuous_aggregate_policy
      • add_policies
      • alter_policies
      • show_policies
      • remove_continuous_aggregate_policy
      • cagg_migrate
      • remove_policies
      • remove_all_policies
    • Data retention
      • add_retention_policy
      • remove_retention_policy
    • Actions and automation
      • add_job
      • alter_job
      • delete_job
      • run_job
    • Hyperfunctions
      • approximate_row_count
      • first
      • last
      • histogram
      • time_bucket
      • time_bucket_ng
      • days_in_month
      • month_normalize
        • hyperloglog
      • Saturating math
        • saturating_add
        • saturating_add_pos
        • saturating_mul
        • saturating_sub
        • saturating_sub_pos
        • stats_agg (one variable)
        • stats_agg (two variables)
        • min_n
        • max_n
        • min_n_by
        • max_n_by
        • candlestick_agg
        • ohlc
      • Gapfilling and interpolation
        • time_bucket_gapfill
        • locf
        • interpolate
        • percentile_agg and uddsketch
        • tdigest
      • Metric aggregation (counters and gauges)
        • counter_agg (point form)
        • gauge_agg
        • rollup
        • corr
        • counter_zero_time
        • delta
        • extrapolated_delta
        • extrapolated_rate
        • first_time, last_time
        • first_val, last_val
        • interpolated_delta
        • interpolated_rate
        • idelta
        • intercept
        • irate
        • num_changes
        • num_elements
        • num_resets
        • rate
        • slope
        • time_delta
        • with_bounds
        • time_weight
      • Downsample
        • asap
        • lttb
        • gp_lttb
      • Frequency Analysis
        • freq_agg
        • topn_agg
        • topn
        • count_min_sketch
        • approx_count
        • into_values (for freq_agg)
        • min_frequency / max_frequency
      • State aggregates
        • state_agg
        • duration_in
        • interpolated_duration_in
        • into_values (for state_agg)
        • rollup (for state_agg)
        • state_timeline
        • state_periods
        • interpolated_state_periods
        • interpolated_state_timeline
        • heartbeat_agg
    • Informational views
      • timescaledb_information.chunks
      • timescaledb_information.continuous_aggregates
      • timescaledb_information.compression_settings
      • timescaledb_information.data_nodes
      • timescaledb_information.dimensions
      • timescaledb_information.hypertables
      • timescaledb_information.jobs
      • timescaledb_information.job_stats
      • timescaledb_experimental.policies
    • Configuration
    • Administration Functions
      • timescaledb_pre_restore
      • timescaledb_post_restore
      • get_telemetry_report
      • dump_meta_data
    • API Reference Tag Overview
  • Timescale Cloud
    • Services
      • Create a service
      • Create a service demo
    • Service overview
    • Service explorer
    • Service operations
      • Resources
      • Autoscale
      • Replication
      • Maintenance
      • VPC
      • Service management
      • Database parameters
        • Customize configuration
        • Advanced parameters
    • Service metrics
    • Service logs
    • Members
      • Members list
    • Integrations
    • Billing
      • Account management
    • Multi-node
    • PostgreSQL extensions
    • Data tiering
      • Tier data to object storage
    • Backup and restore
    • High availability
    • Security
      • Security overview
      • Connect with a stricter SSL mode
    • Migrate a TimescaleDB database to Cloud
      • Migrate the entire database at once
      • Migrate schema and data separately
    • Troubleshooting
  • Managed Service for TimescaleDB
    • About Managed Service for TimescaleDB
    • Clouds and regions
    • Ingest data
    • User management
    • Billing
    • Create a multi-node cluster
    • Connection pools
    • Viewing service logs
    • Logging
    • VPC peering
    • Send metrics to Datadog
    • Integrate Managed Service for TimescaleDB and Google Data Studio
    • Supported extensions
    • Security
    • Create a replica for PostgreSQL service
    • Troubleshooting
    • Maintenance
    • Failover
    • Backups
    • Integrate Managed Service for TimescaleDB as a data source in Grafana
    • Aiven Client for Managed Service for TimescaleDB
      • Install Aiven Client for Managed Service for TimescaleDB
      • Create a fork of the service using Aiven Client
      • Create a read-only replica using Aiven Client
      • Integrate authentication plugins in Grafana
      • Send Grafana emails using Aiven Client
    • Migrate your data to Managed Service for TimescaleDB
    • Migrate your data to Timescale Cloud
    • Using REST API on Managed Service for TimescaleDB
  • Promscale
    • Quick start
    • About Promscale
    • Promscale benefits
    • Install Promscale
      • Kubernetes
      • Docker
      • Binary
      • Debian or Ubuntu
      • RPM based Linux (Red Hat or CentOS)
      • Promscale with Timescale cloud
        • Kubernetes
        • Docker
        • Binary
    • How-to Guides
      • Migrate existing data
      • Upgrade Promscale
    • Recommendations
      • Resource recommendation guide
      • Configuration recommendation guide
    • Backup and Restore Promscale
    • Send data to Promscale
      • Prometheus
      • OpenTelemetry
      • Jaeger
      • Zipkin
      • Remote write API
    • Query data in Promscale
      • Query metrics
      • Query traces
    • Visualize data in Promscale
      • Grafana
      • Jaeger
      • Application Performance Monitoring (APM)
    • Alert in Promscale
    • tobs
      • About tobs
      • Install
    • Scale Promscale
      • Prometheus High availability
      • Prometheus multi-tenancy
    • Monitor Promscale
    • Manage data in Promscale
      • Retention
      • Compression
      • Delete data
      • Maintenance jobs
    • Downsample data
      • Continuous Aggregates
      • Recording Rules
    • Database roles and permissions
    • Troubleshooting Promscale
    • Promscale CLI reference
    • SQL API functions reference
暂无相关搜索结果!

    本文档使用 WanXiangYunDang 构建

    展开/收起文章目录

    思维导图备注

    文章二维码

    手机扫一扫,轻松掌上读

    文档下载

    请下载您需要的格式的文档,随时随地,享受汲取知识的乐趣!
    PDF文档 EPUB文档 MOBI文档

    微信小程序阅读

    BookChat 微信小程序阅读
    微信扫一扫,知识掌上学

    书签列表

      阅读记录

      阅读进度: 0.00% ( 0/0 ) 重置阅读进度