並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 29 件 / 29件

新着順 人気順

select distinct sql postgresの検索結果1 - 29 件 / 29件

  • 型キャストの場所のせいで、秒で終わっていたクエリに1時間超かかるようになってしまった話 - SmartHR Tech Blog

    SmartHRで届出書類という機能を担当しているプロダクトエンジニアのsato-sと申します。 今日は、以前私が調査にとても苦労したパフォーマンス上の問題の話を紹介したいと思います。 TL;DR PostgreSQLのアップグレードを実施した アップグレード後、今までは問題のなかった特定のクエリの実行に1時間超かかり、DBのCPU使用率がピッタリ100%に張り付くようになった 色々調査した結果、PostgreSQL上の型キャストの場所のせいで、良くないクエリプランが選択されることが原因だった 型キャストの場所には気をつけよう PostgreSQLのアップグレードと挫折 SmartHRでは基本的にWebアプリケーションのデータベースとしてGoogle CloudのCloudSQLによって提供されるPostgreSQLを利用しています。 私の担当している届出書類機能では、利用中のPostgre

      型キャストの場所のせいで、秒で終わっていたクエリに1時間超かかるようになってしまった話 - SmartHR Tech Blog
    • 「Postgres で試した?」と聞き返せるようになるまでもしくはなぜ私は雰囲気で技術を語るのか? — Just use Postgres 読書感想文 - じゃあ、おうちで学べる

      はじめに 「Just use Postgres」という言葉を初めて聞いたのは、いつだったか覚えていません。Twitter か Hacker News か、あるいは社内の Slack か。どこで聞いたにせよ、私の反応は決まっていました。「また極端なことを言う人がいる」と。 「それ、〇〇でもできますよ」——この手のフレーズはもう100回は聞いてきました。そして大抵の場合、その〇〇は専用ツールに置き換えられていきます。技術が専門分化していくのは自然な流れです。 全文検索なら Elasticsearch。時系列データなら InfluxDB。メッセージキューなら RabbitMQ。それぞれの分野に専門家がいて、専用のソリューションがあって、ベストプラクティスがあります。「とりあえず Postgres で」なんて、それは思考停止ではないか、と。でも、心のどこかで気になっていたんです。 www.mann

        「Postgres で試した?」と聞き返せるようになるまでもしくはなぜ私は雰囲気で技術を語るのか? — Just use Postgres 読書感想文 - じゃあ、おうちで学べる
      • PostgreSQL実践入門 | 技術評論社

        概要 本書は、PostgreSQLの基本概念から安定稼働・パフォーマンスチューニング、そして現場で役立つ機能までを網羅した、実践的な解説書です。基礎的な解説からはじめ、PostgreSQLの内部構造、テーブル設計、レプリケーション、認証、バックアップ、リストア、モニタリングなどPostgreSQLを現場で利用するための知識を体系的に網羅しています。PostgreSQLの研究開発に従事し、PostgreSQL自身や周辺ツールの開発に携わるメンバーによる執筆で、機能を正しく理解して現場で活用できるノウハウが満載です。 目次 はじめに 読んでいただく際の留意事項 謝辞 目次 第1章:PostgreSQLの概要 リレーショナルデータベースとは データベースとは データモデル リレーショナルデータベースの役割 トランザクション管理 原子性(Atomicity) 一貫性(Consistency) 分離

          PostgreSQL実践入門 | 技術評論社
        • 「ログ」から学んだ PostgreSQL のアーキテクチャの基本 - PLEX Product Team Blog

          こんにちは、Plex Job 開発チームの高岡です。 先日 PLEX TechCon 2025 が開催されました。 惜しくも登壇機会を得られなかったため、本記事にて発表する予定だった内容をまとめてみました。 来年こそは登壇を勝ち取ります 🔥 ▼ 当日の様子はこちら PLEX TechCon 2025 レポート - PLEX Product Team Blog はじめに PostgreSQLの構成 プロセス構成(全体図の赤の要素) メモリ構成(全体図の黄色の要素) 調査した3つのログ 1. チェックポイント処理のログ📝 概要 チューニングポイント 2. 自動バキューム処理のログ 🧹 概要 チューニングポイント 3. TEMP落ちのログ 💣 概要 チューニングポイント work_memを増強してみた Railsによる実装 実行計画で見てみる まとめ 参考 はじめに 以前のプロジェクトで

            「ログ」から学んだ PostgreSQL のアーキテクチャの基本 - PLEX Product Team Blog
          • PostgreSQL 15 Released!

            October 13, 2022 - The PostgreSQL Global Development Group today announced the release of PostgreSQL 15, the latest version of the world’s most advanced open source database. PostgreSQL 15 builds on the performance improvements of recent releases with noticeable gains for managing workloads in both local and distributed deployments, including improved sorting. This release improves the developer e

              PostgreSQL 15 Released!
            • PostgreSQL 16がリリースされる、COPYの性能が最大300%向上などパフォーマンスの改善や論理レプリケーション機能の強化など盛りだくさんな内容

              オープンソースのデータベース「PostgreSQL」のバージョン16がリリースされました。パフォーマンスの改善や論理レプリケーション機能の強化をはじめ、開発者のQOL向上やセキュリティ関連の更新など開発開始から35年経過しているとは思えない盛りだくさんな内容となっています。 PostgreSQL: PostgreSQL 16 Released! https://www.postgresql.org/about/news/postgresql-16-released-2715/ ◆クエリプランナーが改良される ・FULLおよびRIGHTのJOINを並列化可能に ・「DISTINCT」「ORDER BY」節と同時に集計関数を使用したクエリに対してより効率的なプランを生成 ・「SELECT DISTINCT」クエリに対してインクリメンタルソートを使用 ・ウィンドウ関数を最適化 ・RIGHTおよび

                PostgreSQL 16がリリースされる、COPYの性能が最大300%向上などパフォーマンスの改善や論理レプリケーション機能の強化など盛りだくさんな内容
              • PostgreSQLで作る非同期ジョブキュー - enechain Tech Blog

                はじめに 背景と課題 背景 イベントをトリガーとした非同期処理の基本的な構成 改善前のアーキテクチャ 顕在化した課題 改善の方針 アーキテクチャ 実装方式の選定 デキュー: ジョブの取得と実行 ジョブの設計 ジョブのライフサイクル 直列化キーによる順序保証 優先度による実行順の制御 リトライとクラッシュリカバリ デキュークエリ Workerの並行実行 エンキュー: イベントの検知とジョブの生成 ポーリング方式の課題 WALを利用したエンキュー 実装 結果 まとめ はじめに こんにちは、enechainでエンジニアをしている青戸です。 本記事では、イベント駆動な非同期処理のスループットをPostgreSQLのみで改善した事例を紹介します。外部のメッセージブローカーなどを追加せず、PostgreSQLの機能を使ってシンプルな構成のまま性能を向上させられたので、同じような課題に取り組む方の参考に

                  PostgreSQLで作る非同期ジョブキュー - enechain Tech Blog
                • PostgreSQL 16 Released!

                  September 14, 2023 - The PostgreSQL Global Development Group today announced the release of PostgreSQL 16, the latest version of the world's most advanced open source database. PostgreSQL 16 raises its performance, with notable improvements to query parallelism, bulk data loading, and logical replication. There are many features in this release for developers and administrators alike, including mo

                    PostgreSQL 16 Released!
                  • D1: We turned it up to 11

                    We’re not going to bury the lede: we’re excited to launch a major update to our D1 database, with dramatic improvements to performance and scalability. Alpha users (which includes any Workers user) can create new databases using the new storage backend right now with the following command: $ wrangler d1 create your-database --experimental-backend In the coming weeks, it’ll be the default experienc

                      D1: We turned it up to 11
                    • 週刊Railsウォッチ: Shopifyのlanguage server ruby-lsp、PostgreSQL 15 Beta 1リリースほか(20220607後編)|TechRacho by BPS株式会社

                      週刊Railsウォッチについて 各記事冒頭には🔗でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のように)社内有志でつっついたときの会話の再構成です👄 お気づきの点がありましたら@hachi8833までメンションをいただければ確認・対応いたします🙏 TechRachoではRubyやRailsなどの最新情報記事を平日に公開しています。TechRacho記事をいち早くお読みになりたい方はTwitterにて@techrachoのフォローをお願いします。また、タグやカテゴリごとにRSSフィードを購読することもできます(例:週刊Railsウォッチタグ) 🔗Ruby 🔗 Rubyでスクレイピングを書いて中古ギターを買った(Ruby Weeklyより) 元記事: Scraping Buy: Scripting

                        週刊Railsウォッチ: Shopifyのlanguage server ruby-lsp、PostgreSQL 15 Beta 1リリースほか(20220607後編)|TechRacho by BPS株式会社
                      • Go言語のためのRedshift Data API sql driver 『redshift-data-sql-driver』 - KAYAC Engineers' Blog

                        この記事はAWS Analytics Advent Calendar 2022の16日目です。 こんにちは、SREチーム所属の@mashiikeです。 13日目にも記事を書いて、なんと欲張って2回目も書いてます。 13日目の記事は『redshift-data-set-annotator』に関してでした。 このような形で、私は用途がニッチな物を作ることが多いのですが、本日はニッチシリーズの中からGo言語のためのRedshift Data API sql driverについて話します。 Redshift Data API Redshiftへ接続する際は、通常VPCへのアクセスが必要になります。 (Public AccessibilityをONにすればその限りではありませんが、セキュリティを考えると中々ONにすることはためらわれます。) そのため、psqlクライアント等を使って手元から接続するの

                          Go言語のためのRedshift Data API sql driver 『redshift-data-sql-driver』 - KAYAC Engineers' Blog
                        • What’s new in the Postgres 16 query planner / optimizer

                          What’s new in the Postgres 16 query planner / optimizer Written by David Rowley February 8, 2024 PostgreSQL 16 introduces quite a few improvements to the query planner and makes many SQL queries run faster than they did on previous versions of PostgreSQL. If you look at the PG16 release notes, you’ll see some of these planner improvements. But with the volume of changes made in each PostgreSQL rel

                            What’s new in the Postgres 16 query planner / optimizer
                          • Against SQL

                            TLDR The relational model is great: A shared universal data model allows cooperation between programs written in many different languages, running on different machines and with different lifespans. Normalization allows updating data without worrying about forgetting to update derived data. Physical data independence allows changing data-structures and query plans without having to change all of y

                            • Lesser Known PostgreSQL Features

                              In 2006 Microsoft conducted a customer survey to find what new features users want in new versions of Microsoft Office. To their surprise, more than 90% of what users asked for already existed, they just didn't know about it. To address the "discoverability" issue, they came up with the "Ribbon UI" that we know from Microsoft Office products today. Office is not unique in this sense. Most of us ar

                                Lesser Known PostgreSQL Features
                              • A Practitioner's Guide to Wide Events | Jeremy Morrell

                                Adopting Wide Event-style instrumentation has been one of the highest-leverage changes I've made in my engineering career. The feedback loop on all my changes tightened and debugging systems became so much easier. Systems that were scary to work on suddenly seemed a lot more manageable. Lately there have been a lot of good blog posts on what "Wide Events" mean and why they are important. Here are

                                • sqlc generate は何をしているのかメモ

                                  [2023-09-11 追記] 以下のブログの方が分かりやすいので、そちらを読むことをお勧めします。 sqlc internals - 薄いブログ 最近、個人開発で Go のアプリケーションからデータベースを操作するために sqlc を使っている。sqlc は SQL で書いたスキーマのファイルから sqlc generate コマンド一つで Go の構造体を、クエリのファイルから型安全な Go の SQL クライアントを生成することができる。1 私は普段の仕事で ORM が提供するメソッドやクエリビルダを使って SQL を組み立てている。ORM は便利ではあるが、最終的に実行される SQL は可読性が低くてデバッグしづらいことが多い。そのため「最初から SQL を書けば良いのでは…?」と考えるようになり、初めて sqlc を見たとき自分の好みに合うツールと確信した。 使い方は簡単で便利な

                                    sqlc generate は何をしているのかメモ
                                  • 複雑な条件のクエリを集計関数と集合演算を使って短く表現する - Techtouch Developers Blog

                                    この記事はテックタッチアドベントカレンダー22日目の記事です。 こんにちは。データアナリストの bibi です。今回初めてアドベントカレンダーの記事を書きます。よろしくお願いいたします! 2020年12月に入社してからちょうど1年が経ちました。 私の主な業務はデータの取得で、毎日クエリを書きながら、様々なチームの意思決定のサポートをしています。 データの取得クエリは時に非常に複雑になることがありますが、 その一つである、SQLでのリレーション代数系のクエリを解決する方法について、この記事で紹介します。 PostgreSQLのSQLを利用して説明します。 はじめに サンプルデータベース 複雑になってしまっている例 ① 全てのシステムを利用する社員の抽出 ② データアナリスト用システムを利用する社員の抽出 ③ データアナリスト用システムのみを利用する社員の抽出 集計関数を使う方法(Aggreg

                                      複雑な条件のクエリを集計関数と集合演算を使って短く表現する - Techtouch Developers Blog
                                    • Readable standby instances in Amazon RDS Multi-AZ deployments: A new high availability option | Amazon Web Services

                                      AWS Database Blog Readable standby instances in Amazon RDS Multi-AZ deployments: A new high availability option Amazon RDS Multi-AZ deployments are ideal for production database workloads. When you have Multi-AZ deployment, Amazon Relational Database Service (Amazon RDS) provisions one primary and one standby DB instance with synchronous physical replication of Amazon Elastic Block Store (Amazon E

                                        Readable standby instances in Amazon RDS Multi-AZ deployments: A new high availability option | Amazon Web Services
                                      • Database Transactions — PlanetScale

                                        PlanetScale Postgres is the fastest way to run Postgres in the cloud. Plans start at just $5 per month. Learn more By Ben Dicken | January 14, 2026 Transactions are fundamental to how SQL databases work. Trillions of transactions execute every single day, across the thousands of applications that rely on SQL databases. What is a database transaction?A transaction is a sequence of actions that we w

                                          Database Transactions — PlanetScale
                                        • Postgres Full Text Search is better than ... (Part 1)

                                          Everyone needs Full Text Search (FTS) at some point and the most common way to get it is to push your data to Elastic/OpenSearch, Solr, or something else built on top of Lucene. It's a solution that works but adds extra complexity, cost, and consistency challenges. So, what if I told you that, if you're using PostgreSQL, powerful FTS is available to you out of the box? Play alongIf you want to fol

                                            Postgres Full Text Search is better than ... (Part 1)
                                          • オープンセミナー香川2019 PostgreSQL

                                            Citus を使って 分散列指向データベースを作ってみよう Noriyoshi Shinoda November 12, 2021 PostgreSQL Conference Japan 2021 (B2) SPEAKER 篠田典良(しのだのりよし) 所属 日本ヒューレット・パッカード合同会社 現在の業務 PostgreSQL をはじめ、Oracle Database, Microsoft SQL Server, Vertica 等 RDBMS 全般に関するシステムの 設計、移行、チューニング、コンサルティング PostgreSQL パッチ提供 オープンソース製品に関する調査、検証 資格など Oracle ACE Oracle Database 関連書籍15冊の執筆 関連する URL 「PostgreSQL 篠田の虎の巻」シリーズ http://h30507.www3

                                            • PostgreSQL の範囲型

                                              これは何? 前から気になっていた PostgreSQL の範囲型を触ってみたのでメモ。 以下の公式ドキュメントに書かれている以上のことはほとんどしていない。 https://www.postgresql.jp/document/12/html/rangetypes.html また、試してみる中で使った SQL は以下のリポジトリに置いてある。 https://github.com/s-osa/postgres-playground/tree/master/range/sql 動機 アプリケーションで何かしらの範囲を扱いたいケースが存在する。 例として会議室を予約するアプリケーションを考える。 会議室予約アプリケーションでは以下のような要求があり、日時の範囲を扱う必要がある。 ある時刻に予約されている(あるいは予約されていない)会議室を探す 任意の時刻において会議室を予約しているのは高々ひと

                                                PostgreSQL の範囲型
                                              • What I Wish Someone Told Me About Postgres

                                                I’ve been working professionally for the better part of a decade on web apps and, in that time, I’ve had to learn how to use a lot of different systems and tools. During that education, I found that the official documentation typically proved to be the most helpful. Except…Postgres. It’s not because the official docs aren’t stellar (they are!)–they’re just massive. For the current version (17 at t

                                                • 週刊Railsウォッチ: withで作成したリレーションをjoinsで指定可能に、キャッシュストアの例外処理を統一ほか(20230524前編)|TechRacho by BPS株式会社

                                                  こんにちは、hachi8833です。RubyKaigi 2023の余韻がまだ身体に残っています。発表者の皆さま、スタッフとスポンサーの皆さま、参加者の皆さまお疲れさまでした。素晴らしいイベントをありがとうございます! 週刊Railsウォッチについて 各記事冒頭には🔗でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のように)社内有志でつっついたときの会話の再構成です👄 お気づきの点がありましたら@hachi8833までメンションをいただければ確認・対応いたします🙏 TechRachoではRubyやRailsなどの最新情報記事を平日に公開しています。TechRacho記事をいち早くお読みになりたい方はTwitterにて@techrachoのフォローをお願いします。また、タグやカテゴリごとにRSSフィード

                                                    週刊Railsウォッチ: withで作成したリレーションをjoinsで指定可能に、キャッシュストアの例外処理を統一ほか(20230524前編)|TechRacho by BPS株式会社
                                                  • Postgres 15 improves UNIQUE and NULL - Blog @ RustProof Labs

                                                    Postgres 15 beta 2 was released recently! I enjoy Beta season... reviewing and testing new features is a fun diversion from daily tasks. This post takes a look at an improvement to UNIQUE constraints on columns with NULL values. While the nuances of unique constraints are not as flashy as making sorts faster (that's exciting!), improving the database developer's control over data quality is always

                                                    • Sketch of a Post-ORM

                                                      I’ve been writing a lot of database access code as of late. It’s frustrating that in 2023, my choices are still to either write all of the boilerplate by hand, or hand all database access over to some inscrutable “agile” ORM that will become a crippling liability in the 2-3y timescale. This post is about how I want to use databases, from the perspective of an application server developer—not a DBA

                                                        Sketch of a Post-ORM
                                                      • How We Went All In on sqlc/pgx for Postgres + Go

                                                        After a few months of research and experimentation with running a heavily DB-dependent Go app, we’ve arrived at the conclusion that sqlc is the figurative Correct Answer when it comes to using Postgres (and probably other databases too) in Go code beyond trivial uses. Let me walk you through how we got there. First, let’s take a broad tour of popular options in Go’s ecosystem: database/sql: Go’s b

                                                          How We Went All In on sqlc/pgx for Postgres + Go
                                                        • Nine ways to shoot yourself in the foot with PostgreSQL

                                                          23rd April 2023 Previously for Extreme Learning, I discussed all the ways I've broken production using healthchecks. In this post I'll do the same for PostgreSQL. The common thread linking most of these gotchas is scalability. They're things that won't affect you while your database is small. But if one day you want your database not to be small, it pays to think about them in advance. Otherwise t

                                                          • とほほのPostgreSQL入門 - とほほのWWW入門

                                                            目次 PostgreSQLとは インストール psqlコマンド SQL(DDL/DML/DCL) ユーザ ユーザ一覧を表示する(\du) ユーザを作成する(CREATE USER) ユーザを削除する(DROP USER) パスワードを変更する(ALTER USER WITH PASSWORD) ロール ロール一覧を表示する(\du) ロールを作成する(CREATE ROLE) ロールを削除する(DROP ROLE) データベース データベースの一覧を表示する(\l) データベースを作成する(CREATE DATABASE) データベースを削除する(DROP DATABASE) データベースのオーナーを変更する(ALTER DATABASE OWNER TO) データベースを変更する(\c) スキーマ スキーマの一覧を表示する(\dn) スキーマを作成する(CREATE SCHEMA) スキ

                                                            1