一个PostgreSQL查询可以使用多个内核吗?

前端之家收集整理的这篇文章主要介绍了一个PostgreSQL查询可以使用多个内核吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Postgresql的最新版本中(截至2013年12月),我们可以在两个或更多内核之间共享查询以获得性能提升吗?或者我们应该获得更快的核心?
不,对于v9.6之前的Postgresql版本.请参阅 the PostgreSQL FAQ:Postgresql如何使用cpu资源?

The Postgresql server is process-based (not threaded). Each database session connects to a single Postgresql operating system (OS) process. Multiple sessions are automatically spread across all available cpus by the OS. The OS also uses cpus to handle disk I/O and run other non-database tasks. Client applications can use threads,each of which connects to a separate database process.

Since version 9.6,portions of some queries can be run in parallel,in separate OS processes,allowing use of multiple cpu cores. Parallel queries are enabled by default in version 10 (max_parallel_workers_per_gather),with additional parallelism expected in future releases.

猜你在找的Postgre SQL相关文章