Как мы ускорили выполнение запросов PostgreSQL в 100 раз
Существует великое множество статей об оптимизации PostgreSQL — эта «кроличья нора» весьма глубока. Когда несколько лет назад я начал разрабатывать бэкэнд аналитического сервиса, у меня уже был опыт работы с другими СУБД, такими как MySQL и SQL Server. Тем не менее, раньше мне не приходилось так фокусироваться на производительности. В прошлых проектах, над которыми я работал, либо не было жестких требований к времени обработки (DS/ML), либо не требовалось обрабатывать много строк одновременно (обыкновенные веб-приложения). Однако в этот раз мои запросы:
· состояли из 3-10 JOIN-ов по коррелирующим запросам;
· уielded от 10 до 1,000,000 строк;
· должны были выполняться в течение времени, определенного UX-ом;
· не могли быть hinted — пока Cloud SQL, управляемый PostgreSQL в Google Cloud, не стал поддерживать pg_hint_plan в конце 2021 года;
· запрещали прямой доступ к серверному процессу, чтобы, например, хакнуть некоторые perf — потому что PostgreSQL был managed.
Получение целого миллиона строк в одном API endpoint сигнализирует о проблеме в алгоритме или архитектуре. Конечно, все можно переписать и перепроектировать, но за это нужно платить.
У нас не нашлось «заклинания», которое решило бы все проблемы с производительностью SQL. Тем не менее, я упомяну здесь несколько дельных предложений, которые помогли нам и, надеюсь, смогут помочь читателю. Разумеется, это не какие-то сакральные знания. Но когда мы начинали оптимизацию, я был бы рад их прочитать или услышать.
Читать: https://habr.com/ru/post/659455/
Существует великое множество статей об оптимизации PostgreSQL — эта «кроличья нора» весьма глубока. Когда несколько лет назад я начал разрабатывать бэкэнд аналитического сервиса, у меня уже был опыт работы с другими СУБД, такими как MySQL и SQL Server. Тем не менее, раньше мне не приходилось так фокусироваться на производительности. В прошлых проектах, над которыми я работал, либо не было жестких требований к времени обработки (DS/ML), либо не требовалось обрабатывать много строк одновременно (обыкновенные веб-приложения). Однако в этот раз мои запросы:
· состояли из 3-10 JOIN-ов по коррелирующим запросам;
· уielded от 10 до 1,000,000 строк;
· должны были выполняться в течение времени, определенного UX-ом;
· не могли быть hinted — пока Cloud SQL, управляемый PostgreSQL в Google Cloud, не стал поддерживать pg_hint_plan в конце 2021 года;
· запрещали прямой доступ к серверному процессу, чтобы, например, хакнуть некоторые perf — потому что PostgreSQL был managed.
Получение целого миллиона строк в одном API endpoint сигнализирует о проблеме в алгоритме или архитектуре. Конечно, все можно переписать и перепроектировать, но за это нужно платить.
У нас не нашлось «заклинания», которое решило бы все проблемы с производительностью SQL. Тем не менее, я упомяну здесь несколько дельных предложений, которые помогли нам и, надеюсь, смогут помочь читателю. Разумеется, это не какие-то сакральные знания. Но когда мы начинали оптимизацию, я был бы рад их прочитать или услышать.
Читать: https://habr.com/ru/post/659455/
👍1
Sql Aggregations
I recently just started my journey to become a data analyst, so naturally, I had to learn SQL.
During my course of learning, I came across the SQL aggregate functions. I came to learn how vital aggregate functions are in SQL data management. They ar...
Read: https://hashnode.com/post/sql-aggregations-cl1xrw9e800oulmnvf35fh0g8
I recently just started my journey to become a data analyst, so naturally, I had to learn SQL.
During my course of learning, I came across the SQL aggregate functions. I came to learn how vital aggregate functions are in SQL data management. They ar...
Read: https://hashnode.com/post/sql-aggregations-cl1xrw9e800oulmnvf35fh0g8
Architecture Case Study: Complex Data-Tier Systems within Multi-Tier Architecture
Today, we are going to solve a technology company's data-tier multi-tier architecture problems. This company is one of the newest and fastest growing technology companies of the year. It is a USA based company with more than 5,000 employees, among wh...
Read: https://danielbossou.hashnode.dev/architecture-case-study-complex-data-tier-systems-within-multi-tier-architecture
Today, we are going to solve a technology company's data-tier multi-tier architecture problems. This company is one of the newest and fastest growing technology companies of the year. It is a USA based company with more than 5,000 employees, among wh...
Read: https://danielbossou.hashnode.dev/architecture-case-study-complex-data-tier-systems-within-multi-tier-architecture
Где и как хранит данные западный бизнес?
Мы решили поделиться результатами опроса, проведенного агентством S&P Global в начале 2022 года. Они позволяют узнать, какие поставщики систем хранения данных и какие технологии лидируют в 2022-м, кто готов сменить свою СХД и почему.
Взглянуть на рейтинги и цифры
Читать: https://habr.com/ru/post/660841/
Мы решили поделиться результатами опроса, проведенного агентством S&P Global в начале 2022 года. Они позволяют узнать, какие поставщики систем хранения данных и какие технологии лидируют в 2022-м, кто готов сменить свою СХД и почему.
Взглянуть на рейтинги и цифры
Читать: https://habr.com/ru/post/660841/
What is a Bloom Filter 🤔
Suppose you are creating an account on Twitch or any other website, you will immediately think of a cool username like noobmaster69🙃 and when you submit the form you immediately get "User Name Already Taken"😡 you will try out other cool names or ev...
Read: https://hashnode.com/post/what-is-a-bloom-filter-cl1yv82eg00i3y6nv5hvpfvjq
Suppose you are creating an account on Twitch or any other website, you will immediately think of a cool username like noobmaster69🙃 and when you submit the form you immediately get "User Name Already Taken"😡 you will try out other cool names or ev...
Read: https://hashnode.com/post/what-is-a-bloom-filter-cl1yv82eg00i3y6nv5hvpfvjq
Find the best Biotechnology Email List | Biotechnology Mailing list in US
Are you seeking reliable data on the biotech sector? AverickMedia's Biotechnology Email List can put you in touch with researchers, life sciences professionals, and biotechnologists from all around the world. Our proper data analysis allows us to pro...
Read: https://hashnode.com/post/find-the-best-biotechnology-email-list-or-biotechnology-mailing-list-in-us-cl1yzx17m0121y6nv28016h1n
Are you seeking reliable data on the biotech sector? AverickMedia's Biotechnology Email List can put you in touch with researchers, life sciences professionals, and biotechnologists from all around the world. Our proper data analysis allows us to pro...
Read: https://hashnode.com/post/find-the-best-biotechnology-email-list-or-biotechnology-mailing-list-in-us-cl1yzx17m0121y6nv28016h1n
Save costs by automating the start and stop of Amazon RDS instances with AWS Lambda and Amazon EventBridge
Read: https://aws.amazon.com/blogs/database/save-costs-by-automating-the-start-and-stop-of-amazon-rds-instances-with-aws-lambda-and-amazon-eventbridge/
Read: https://aws.amazon.com/blogs/database/save-costs-by-automating-the-start-and-stop-of-amazon-rds-instances-with-aws-lambda-and-amazon-eventbridge/
Enhanced AWS Backup features for Amazon DynamoDB
Read: https://aws.amazon.com/blogs/database/enhanced-aws-backup-features-for-amazon-dynamodb/
Read: https://aws.amazon.com/blogs/database/enhanced-aws-backup-features-for-amazon-dynamodb/
Database Locking
Introduction
When many people attempt to modify data in a database at the same time, a system of controls must be implemented so that modifications made by one person do not adversely affect those of another person. This is called concurrency control...
Read: https://codeminion.hashnode.dev/database-locking
Introduction
When many people attempt to modify data in a database at the same time, a system of controls must be implemented so that modifications made by one person do not adversely affect those of another person. This is called concurrency control...
Read: https://codeminion.hashnode.dev/database-locking
Oracle 21c Persistent Memory Database – Eliminate Latency with Directly Mapped Buffer Cache
Persistent Memory Database using Directly Mapped Buffer Cache feature in Oracle 21c and beyond.
Read: https://blogs.oracle.com/database/post/oracle-21c-persistent-memory-database-direct-mapped-buffer-cache
Persistent Memory Database using Directly Mapped Buffer Cache feature in Oracle 21c and beyond.
Read: https://blogs.oracle.com/database/post/oracle-21c-persistent-memory-database-direct-mapped-buffer-cache
How to Avoid Cartesian Explosion while using EF Core
Cartesian Product
Cartesian product is a mathematical denoscription of a multiplication of two sets. When the first set consists of two elements and the second one consists of three elements, the cartesian product result set consists of 6 elements. Eac...
Read: https://trycatchblog.tech/how-to-avoid-cartesian-explosion-while-using-ef-core
Cartesian Product
Cartesian product is a mathematical denoscription of a multiplication of two sets. When the first set consists of two elements and the second one consists of three elements, the cartesian product result set consists of 6 elements. Eac...
Read: https://trycatchblog.tech/how-to-avoid-cartesian-explosion-while-using-ef-core
Understanding Isolation levels in SQL Server
A transaction is a group of T-SQL statements performing single or multiple operations on objects as a single unit. If any of the statements in the transaction fails, then the whole operation reverts due to transaction rollback. This assures that thos...
Read: https://mssqlserver.dev/understanding-isolation-levels-in-sql-server
A transaction is a group of T-SQL statements performing single or multiple operations on objects as a single unit. If any of the statements in the transaction fails, then the whole operation reverts due to transaction rollback. This assures that thos...
Read: https://mssqlserver.dev/understanding-isolation-levels-in-sql-server
Aggregation in MongoDB
Hello, devs 👋
In this blog, we will learn the basics of the MongoDB aggregation framework to filter, sort, group, and transform our MongoDB results. MongoDB helps us to do all these operations through aggregation pipelines which are a series of oper...
Read: https://saurabhbomble.hashnode.dev/aggregation-in-mongodb
Hello, devs 👋
In this blog, we will learn the basics of the MongoDB aggregation framework to filter, sort, group, and transform our MongoDB results. MongoDB helps us to do all these operations through aggregation pipelines which are a series of oper...
Read: https://saurabhbomble.hashnode.dev/aggregation-in-mongodb
Как настроить Kerberos аутентификации в Keycloak
Виктор Попов, техлид DevOps-команды в X5 Tech и спикер курса «Безопасность проекта: аутентификация в Keycloak», подготовил туториал. В нём он рассказывает, как настроить Kerberos аутентификации в Keycloak и как подготовить браузеры для работы.
Читать: https://habr.com/ru/post/661209/
Виктор Попов, техлид DevOps-команды в X5 Tech и спикер курса «Безопасность проекта: аутентификация в Keycloak», подготовил туториал. В нём он рассказывает, как настроить Kerberos аутентификации в Keycloak и как подготовить браузеры для работы.
Читать: https://habr.com/ru/post/661209/
Architecture Case Study: Complex Data-Tier Systems within Multi-Tier Web Architecture
Today, we are going to solve a technology company's data-tier multi-tier architecture problems. This company is one of the newest and fastest growing technology companies of the year. It is a USA based company with more than 5,000 employees, among wh...
Read: https://danielbossou.hashnode.dev/architecture-case-study-complex-data-tier-systems-within-multi-tier-web-architecture
Today, we are going to solve a technology company's data-tier multi-tier architecture problems. This company is one of the newest and fastest growing technology companies of the year. It is a USA based company with more than 5,000 employees, among wh...
Read: https://danielbossou.hashnode.dev/architecture-case-study-complex-data-tier-systems-within-multi-tier-web-architecture
Every Day Is Tax Day When Your Data Architecture Is Too Complex
Read: https://www.mongodb.com/blog/post/every-day-tax-day-when-your-data-architecture-too-complex
Read: https://www.mongodb.com/blog/post/every-day-tax-day-when-your-data-architecture-too-complex
Day 26/100
Designing Data-Intensive Applications [Book Highlights]
[Part I : Chapter II] Data Models and Query Languages
The Cypher Query Language
Cypher is a declarative query language for property graphs, created for the Neo4j
graph database
Example 2-4. Cyp...
Read: https://rawdatareaders.hashnode.dev/day-26
Designing Data-Intensive Applications [Book Highlights]
[Part I : Chapter II] Data Models and Query Languages
The Cypher Query Language
Cypher is a declarative query language for property graphs, created for the Neo4j
graph database
Example 2-4. Cyp...
Read: https://rawdatareaders.hashnode.dev/day-26
«Импортозамещаем» анализ планов PostgreSQL
Вчера Hubert 'depesz' Lubaczewski закрыл доступ с российских IP ко всем своим сайтам, включая широко известный визуализатор планов PostgreSQL-запросов explain.depesz.com.
Но это не беда, потому что в компании "Тензор" мы разработали сервис explain.tensor.ru, функционал которого гораздо обширнее, и которым можете воспользоваться и вы.
Читать: https://habr.com/ru/post/660727/
Вчера Hubert 'depesz' Lubaczewski закрыл доступ с российских IP ко всем своим сайтам, включая широко известный визуализатор планов PostgreSQL-запросов explain.depesz.com.
Но это не беда, потому что в компании "Тензор" мы разработали сервис explain.tensor.ru, функционал которого гораздо обширнее, и которым можете воспользоваться и вы.
Читать: https://habr.com/ru/post/660727/
Day 27/100
Designing Data-Intensive Applications [Book Highlights]
[Part I : Chapter III] Storage and Retrieval
fundamentals of a database are two things: it should store the data, it should give it back as well.
Consider the world’s simplest database, imple...
Read: https://rawdatareaders.hashnode.dev/day-27
Designing Data-Intensive Applications [Book Highlights]
[Part I : Chapter III] Storage and Retrieval
fundamentals of a database are two things: it should store the data, it should give it back as well.
Consider the world’s simplest database, imple...
Read: https://rawdatareaders.hashnode.dev/day-27
Set up your application with Heroku's Database
Heroku is a cloud platform as a service (PaaS) supporting several programming languages as well as RDBMS like Postgres
In this blog, you're going to learn "How to set up your application with Heroku's Database"
Prerequisites
Basic JS, Postgres knowl...
Read: https://eklavya.hashnode.dev/set-up-your-application-with-herokus-database
Heroku is a cloud platform as a service (PaaS) supporting several programming languages as well as RDBMS like Postgres
In this blog, you're going to learn "How to set up your application with Heroku's Database"
Prerequisites
Basic JS, Postgres knowl...
Read: https://eklavya.hashnode.dev/set-up-your-application-with-herokus-database