Cortex, a horizontally scalable version of Prometheus, enhances PromQL query performance by leveraging distributed systems and consistent hashing. Created by Grafana Labs, Cortex integrates the PromQL engine to provide a global view across multiple Prometheus servers, overcoming the cardinality limitation of 100,000 time series per query. The Grafana Labs team introduced a stateless query microservice called the "querier" and incorporated extensive caching, including memcache, to improve query speed and efficiency. By aligning start and end times with the query step and splitting queries by day, Cortex can execute queries on multiple cores, significantly enhancing performance. This approach not only allows for parallel execution of queries but also ensures a fair distribution of resources among users in a multi-tenant system. The enhancements have led to substantial improvements in query speed, reducing the time taken from seconds to milliseconds. Future plans for Cortex involve further parallelization by series, automatic identification of subqueries, and ensuring reliability and ease of deployment.