Skip to content
ℕ𝔸𝕊𝔸™ℕ𝕒𝕤𝕒𝕣𝕖™𝕊𝕡𝕒𝕔𝕖𝕏™ https://nasa.re/

Nasare™🚀

フレッシュ スペース & テクノロジー NEWS📢

  • About 𝒩𝒶𝓈𝒶𝓇𝑒™
  • SMART Tools
  • SMART AI
    • Kubeshark PCAP Export/Import
    • Coaching engineering managers to employ on organizational issues
    • Zelda: Hyperlink’s Awakening game engine documentation (2021)
    • Commercial Resupply Services-CRS
  • Show HN
    • WINd3x、iPod Bootrom エクスプロイトは 10 年遅かった
    • Just by Notでプログラミングするシステム オブジェクト指向プログラミングの活用
    • 主な BGP 増加をレジデンス Windows デスクトップに追加する
    • ガジェットの複雑さが増し、余分な IP の再利用が促進される
    • 新しい GitHub CLI 拡張インストゥルメント
    • Kubernetes を 7,500 ノードにスケーリング (2021 年)
    • Wander アプリ用の軽量なオンザフリット構成ライブラリ
    • Ask HN
      • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
      • Describe HN: Kandria, an action RPG made in Frequent Voice, is now out
      • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
      • Brand HN: Motion photographs Watchlist Chrome Extension
      • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
      • Level to HN: An initiate source tool to generate Jet Engine compressors
      • Insist HN: Ov – characteristic smartly off terminal pager
      • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
      • Level to HN: A corpulent game of snake encoded in a url
      • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
      • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
      • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
      • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
      • Speak HN: What sub $200 product improved HN readers’ 2022
      • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
      • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
    • Show HN
      • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
      • Android phones will at the moment obtain iPhone-love SOS satellite texting
      • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
      • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
      • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
      • Insist HN: Ov – characteristic smartly off terminal pager
      • Level to HN: An initiate source tool to generate Jet Engine compressors
      • Speak HN: What sub $200 product improved HN readers’ 2022
      • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
      • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
      • Level to HN: A corpulent game of snake encoded in a url
    • Brand HN: Motion photographs Watchlist Chrome Extension
    • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
    • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
    • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
    • Tag HN: Using Key-Value Retail outlets in Serverless Codehooks.io Applications
    • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
    • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
    • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
    • Brand HN: Motion photographs Watchlist Chrome Extension
    • Level to HN: A corpulent game of snake encoded in a url
    • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
    • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
    • Speak HN: What sub $200 product improved HN readers’ 2022
    • Level to HN: An initiate source tool to generate Jet Engine compressors
    • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
    • Insist HN: Ov – characteristic smartly off terminal pager
    • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
    • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
    • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
    • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
  • A Computer virus and a Dilemma
    • OCIS – OwnCloud Countless Scale
    • A Princeton student built an app which is ready to detect if ChatGPT wrote an essay
    • GitHub Is Sued, and We Would possibly perhaps Learn Something About Creative Commons Licensing
    • Adobe’s Command material analysis can be using photos/videos to narrate AI w/o consent
    • Ultralearning a.k.a. how I learned to code
    • Automatic1111 is assist on GitHub after taking away Embedding Links
    • Where Your Sides Came From
    • What Is a Pig Butchering Rip-off?
    • Submit-processing is ruining iPhone photos
    • Clos Topologies and Centralized Retain a watch on in Google’s Datacenter Community
    • Miller Engineering DS-1 House Planetarium
    • Gimel Studio: Non-harmful, 2D image editor
  • Technology
    • Miller Engineering DS-1 House Planetarium
    • Apple Doctors: to construct it as a file it is advisable to electronic mail it to your self
    • The Air India passenger who urinated on a girl has been fired by Wells Fargo
    • The Filesystem Hierarchy Usual Comes to Guix Containers
    • Sooner than it sued Google for copying from Java, Oracle changed into as soon as copying IBM’s SQL (2020)
    • The i3-gaps mission has been merged with i3
    • Making an Alphorn from Scratch
    • Apple: Braille Individual Guides
    • MotherDuck Is a Original Thought
    • The class of CGI and simple make
    • Like a mercurial tour of DragonFly BSD 6.4?
    • computer science
    • AI
    • Artificial intelligence
    • Technology
    • Ai
    • Apple
    • digital
  • TOP HN
    • anti-Mastodon
    • TOP HN
      • Show HN
      • Ask HN
      • coding
      • ガジェットの複雑さが増し、余分な IP の再利用が促進される
      • 新しい GitHub CLI 拡張インストゥルメント
      • Kubernetes を 7,500 ノードにスケーリング (2021 年)
      • Just by Notでプログラミングするシステム オブジェクト指向プログラミングの活用
      • Describe HN: Kandria, an action RPG made in Frequent Voice, is now out
      • WINd3x、iPod Bootrom エクスプロイトは 10 年遅かった
      • Wander アプリ用の軽量なオンザフリット構成ライブラリ
      • Artificial intelligence
      • 主な BGP 増加をレジデンス Windows デスクトップに追加する
      • Technology
      • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
      • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
      • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
      • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
      • Advise HN: Daft Art – an album veil maker powered by AI and curated aesthetics
      • Brand HN: Motion photographs Watchlist Chrome Extension
      • Declare HN: I wrote a WebAssembly Interpreter and Toolkit in C
      • Demonstrate HN: ClickHouse-local – a runt instrument for serverless files analytics
      • Describe HN: Kandria, an action RPG made in Frequent Voice, is now out
      • Existing HN: Connmap – Desktop widget that reveals your TCP company on an international diagram
      • Insist HN: Ov – characteristic smartly off terminal pager
      • Just by Notでプログラミングするシステム オブジェクト指向プログラミングの活用
      • Kubernetes を 7,500 ノードにスケーリング (2021 年)
      • Level to HN: A corpulent game of snake encoded in a url
      • Level to HN: An initiate source tool to generate Jet Engine compressors
      • Level to HN: Graphic-Walker – A special kind of originate-offer different to Tableau
      • Point out HN: Kweb: A a ways away interface to the earn browser’s DOM
      • Present HN: Nanelo DNS – Privacy-Kindly, European Nameservers
      • Reward HN: Vim on-line editor the exercise of WebAssembly, storing files the exercise of IndexedDB
      • Show HN: AREnets – TensorFlow-basically based mostly Relation Extraction equipment for work in Colab
      • Speak HN: What sub $200 product improved HN readers’ 2022
      • Uncover HN: Easy internet app for teenagers to management a single Philips Hue light
      • Wander アプリ用の軽量なオンザフリット構成ライブラリ
      • WINd3x、iPod Bootrom エクスプロイトは 10 年遅かった
      • ガジェットの複雑さが増し、余分な IP の再利用が促進される
      • 主な BGP 増加をレジデンス Windows デスクトップに追加する
      • 新しい GitHub CLI 拡張インストゥルメント
      • ロンドンで*ダウン*を継続的に見つめる: Pavement Oddities
      • 報酬 HN: C の 30 行でスピンロック
      • FAA の NOTAM とは何ですか? 航空専門家が機械の仕組みを説明
      • ナノGPT
      • 1 ビット LCD のグレースケール (2022)
      • The Muse (YC W12) は FP&A のシニア ディレクターを採用しています
      • Zen (YC S21) はグロース エンジニアを採用しています
      • Tall Inquire of (YC W21) が B2B 回顧録の幹部を採用
      • Actiondesk (YC S19) は、プロダクト ドレスメーカーを採用しています (4-6 か月の契約)
      • Oven (YC S19) は、Bun を作成するために C/C++ または Zig エンジニアを採用しています。
      • WInd3x, the iPod Bootrom exploit 10 years too unhurried
      • Sign HN: FASTA recordsdata を操作するための FUSE モジュール
      • HN を指します: Socketify.py: PyPy3 および Python3 用の Http/Https および WebSocket サーバー
      • Wage Development Continues to Gradual in the UK and Euro House
      • Stage Supervisor for the unimpressed: 1 Getting started
      • First public free up of Pushup: a brand unique compiler for making net apps in Trip
      • Fixing Cart-Pole Swingup with a Hierarchical Controller
      • Flight Testing the Touchdown Radar for Mars Science Laboratory 2011-06-21T17:36:36Z
      • Flightcontrol (YC W22) is hiring first Developer Recommend
      • Flying boats and other tech for cleaner shipping
      • Four Finalist Touchdown Location Candidates for Mars Science Laboratory 2008-11-19T16:21:01Z
      • France’s prized nuclear sector stalled in Europe’s hour of want
      • French startup unveils new residential thermo-acoustic warmth pump
      • FTC Cracks Down on Firms That Impose Contaminated Noncompete Restrictions
      • FTX’s Aged Prime Lawyer Aided US Authorities in Bankman-Fried Case
      • FY18 NASA lėšų šnypštimas 2017-05-22T00:00:00Z
      • G-3PO: A protocol droid for Ghidra, or GPT-3 for reverse-engineering
      • Gail.com FAQ
      • Gemini-Titan (GT)-6 – Gemini 6 of 7 – 지역 사진 – 외부 지역 1965-12-15T00:00:00Z
      • Geoffrey Hinton Publishes Original Deep Learning Algorithm
      • Germany warns: AI fingers flee already underway (2021)
      • Gimel Studio: Non-harmful, 2D image editor
      • GitHub Availability File
      • GitHub Is Sued, and We Would possibly perhaps Learn Something About Creative Commons Licensing
      • Google needs RISC-V to be a “tier-1” Android architecture
      • Google researcher, lengthy out of math, cracks devilish dispute about gadgets
      • Google start sourced CDC File Transfer from the ashes of Stadia
      • GRC-2003-C-02097 2004-05-01T00:00:00Z
      • GRC-2013-C-05246 2009-11-26T00:00:00Z
      • Hello world!
      • Highlights of Science Launching on SpaceX CRS-15 2018-06-24T00:00:00Z
      • Hilf Al-Fudul
      • HiOperator (YC S16) Is Hiring VP of Engineering
      • HN を指します: Socketify.py: PyPy3 および Python3 用の Http/Https および WebSocket サーバー
      • How kind I blueprint a pair of buttocks?
      • How will the haj switch as international temperatures upward thrust?
      • Human gene linked to bigger brains turned into as soon as born from apparently pointless DNA
      • Hundreds of scientists publish a paper every 5 days
      • In Favor of Friction and Flexibility
      • Indicate HN: Klotho – Change into straightforward code into cloud native code
      • Indoor farming isn’t exact for the smartly off
      • Iranian assault drone came across to have parts from more than a dozen US companies
      • Israeli researcher experiences leak of 235M Twitter-linked e-mail addresses
      • Jam Stations in Low Earth Orbit
      • Jazz Is Freedom
      • JPL-20171102-TECHf-0001-ドローントリップ 人間vs機械 2017-11-17T00:00:00Z
      • JPL에서 NASA의 MSI 콘도미니엄 액셀러레이터 2022-08-25T00:00:00Z
      • JPSO extinct facial recognition abilities to arrest a man. The tech modified into once defective
      • jsc2017e136097 – 12 月 4 日,俄罗斯联邦地区公司 (Roscosmos) 的远征 54-55 号机组人员 Anton Shkaplerov 在俄罗斯 Principal person City 的加加林宇航员训练中心上向整洁的祝福者挥手致意,当时他登上了前往附近的 Chkalovsky Ai 的公共汽车2017-12-04T00:00:00Z
      • Kemble’s Cascade of Stars
      • Kepler-90 マシン (アーティストの考え) 2017-12-14T00:00:00Z
      • Koichi Wakata SpaceX 코칭 2022-06-27T00:00:00Z
      • KSC and Proud to Be Heart-Wide Diversity Tournament 2019-08-20T00:00:00Z
      • KSC ir „Proud to Be Center“ įvairovės turnyras 2019-08-20T00:00:00Z
      • AI
      • Artificial intelligence
      • Auto-Generate
      • anti-Mastodon
      • Awesome
      • BioSentinel
      • CATEGORIES
      • DC
      • Dione
      • Diversity
      • drone racing
      • drones
      • Dulles
      • education
      • Event
      • filmstock
      • Goddard
      • AI
      • Ask HN
      • autonomous
      • coding
      • computer science
      • Clusters
      • Artificial intelligence
        • Ai
        • Apple
        • Tesla
        • digital
        • MESSENGER
        • Device
        • Charts
        • change
        • Shows
        • fraud
        • Former
        • fucking
        • purge
        • Works
        • entering
        • Databases
        • Review
        • Strangely
        • Instinct
        • staff
        • Salesforce
        • intern
        • Involuntary
        • promise
        • Twilio’s
        • nisv live
        • attack
        • Iranian
        • France’s
        • prized
        • infrastructure
        • Debian-based
        • nisv s02 ep03
        • siduction
        • Awesome
        • Calculate
        • Beautiful
        • Linux
        • Start
        • dollar
        • Messier
        • Daughters
        • ‘Breakthrough’
        • obesity
        • Al-Fudul
        • sixty years
        • PyTorch
        • discloses
        • Ancient
        • Stone
        • Popup
        • design
        • public
        • expanding
        • cloud
        • forest
        • startup
        • French
        • batteries
        • fleas
        • spotted
        • Petals
        • language
        • Habitual
        • checking
        • GitHub
        • Availability
        • layers
        • inconsistencies
        • Affair
        • Quasi-War
        • Sergey
        • Irate
        • bestseller
        • necessarily
        • Scientists
        • Titan
        • twitch
        • FGS/NIRISS – Fine Guidance Sensor/Near InfraRed Imager and Slitless Spectrograph
        • infrared
        • ISIM – Integrated Science Instrument Module
        • JHU – Johns Hopkins University
        • JWST – James Webb Space Telescope
        • JWST – James Webb Space Telescope
        • absolute zero
        • Big Bang
        • Peace
        • Studio
        • Making
        • project
        • -gaps
        • warns
        • Germany
        • Braille
        • MotherDuck
        • prototype
        • Challenges
        • Infinite
        • OwnCloud
        • Novel
        • Before
        • copying
        • California
        • getting
        • States
        • Criminal
        • Brother
        • Released
        • Method
        • owners
        • ‘richsession’
        • email
        • Elements
        • Where
        • passenger
        • Hierarchy
        • Filesystem
        • economic
        • Crew Dragon
        • Bridenstine
        • Scientific
        • Heaviosity
        • Patterns
        • Unexpected
        • minimalist
        • Ecode
        • Alpha
        • Wolfram
        • Tailwind
        • HiOperator
        • Klotho
        • TEAMS
        • ROBOTICS
        • Antelope
        • Sponsors
        • Ellen Gertsen
        • Transform
        • Flightcontrol
        • subscriptions
        • Internet
        • Theory-building
        • you’re
        • looking
        • Transfer
        • error’
        • Tails
        • migrate
        • Building
        • Bitmovin
        • Remote
        • PhotoRoom
        • Company
        • Taking
        • Ribbon
        • BibDesk
        • Android
        • profilers
        • phones
        • modern
        • Mastercard
        • private
        • We’ve
        • reportedly
        • Microsoft
        • Artsy
        • trades
        • skilled
        • Polygon
        • Flying
        • Princeton
        • Codemods
        • Coaching
        • UK’s
        • popping
        • sourced
        • Wikipedia
        • admin
        • Indoor
        • quick
        • Mysterious
        • Spotify
        • Fancy
        • Spotify
        • Weird
        • mail-order
        • Recipients
        • computer
        • optics
        • partnership
        • commercial
        • telemetry
        • Crisis
        • billionaire
        • Party
        • Onelab
        • Faster
        • general
        • Adobe’s
        • database
        • FinanceDatabase
        • Numerical
        • Freedom
        • concrete
        • Stacks
        • computer science
        • NASA
    • Show HN
    • Ask HN
    • Technology
    • computer science
    • coding
    • Clusters
    • AI
    • drones
    • autonomous
    • Auto-Generate
    • Ask HN
    • Show HN
    • The SMART Science™
    • google
  • CRYPTO
    • Blockchain
    • farming
    • Billionaires
    • FTX’s
    • FinanceDatabase: A database of 300.000 symbols (ETFs, Currencies, Crypto)
  • Artificial intelligence
  • Toggle search form
  • HIVの治癒が確認された5人目の患者
    HIVの治癒が確認された5人目の患者 anti-Mastodon
  • Steam デッキは意図的に生まれたわけではありませんが、現在は意図的です
    Steam デッキは意図的に生まれたわけではありませんが、現在は意図的です anti-Mastodon
  • Git のセキュリティ脆弱性を提供
    Git のセキュリティ脆弱性を提供 Artificial intelligence
  • HN のデモンストレーション: PySdfScad、openSCAD インタープリター、signed-distance-functions の使用
    HN のデモンストレーション: PySdfScad、openSCAD インタープリター、signed-distance-functions の使用 Awesome
  • 2023 年の Appsmith やその他の OSS 内部ツールの次の予定は?
    2023 年の Appsmith やその他の OSS 内部ツールの次の予定は? anti-Mastodon
  • QuestDB (YC S20) は Python エンジニアを採用しています
    QuestDB (YC S20) は Python エンジニアを採用しています Artificial intelligence
  • MacBook ハードウェアを閉じると、マイク、セキュリティ/プライバシーの特性が切断されます
    MacBook ハードウェアを閉じると、マイク、セキュリティ/プライバシーの特性が切断されます Artificial intelligence
  • OpenSearch Files Prepper はブランド離れしたバージョンをリリースします。
    OpenSearch Files Prepper はブランド離れしたバージョンをリリースします。 anti-Mastodon
  • Mastercard Faucets Polygon for Web3 Musical Artist Accelerator Program
    Mastercard Faucets Polygon for Web3 Musical Artist Accelerator Program NASA
  • ウォーム Docker コンテナーを使用して 5 倍早くデプロイします
    ウォーム Docker コンテナーを使用して 5 倍早くデプロイします Julian Assange
  • レーベル HN: Voice.cpp と YAKE によるリカウント リフレクションの分析 [iOS]
    レーベル HN: Voice.cpp と YAKE によるリカウント リフレクションの分析 [iOS] Analyse
  • The Involuntary Pacifists
    The Involuntary Pacifists NASA
  • DreamWorks が OpenMoonRay ソースコードをリリース
    DreamWorks が OpenMoonRay ソースコードをリリース Artificial intelligence
  • Rippling がシリーズ E の資金調達で $5 億を調達
    Rippling がシリーズ E の資金調達で $5 億を調達 anti-Mastodon
  • ゼロからのMINIX
    ゼロからのMINIX Artificial intelligence
Rails で N+1 クエリを取得、デバッグ、修正する方法に関するトリック

Rails で N+1 クエリを取得、デバッグ、修正する方法に関するトリック

Posted on March 7, 2023 By 📢 𝕂𝕒𝕤𝕡𝕖𝕣𝕤𝕜𝕪™

[:line]

N+1 の複雑さを修正することは、常に Rails アプリを最適化する上で最も簡単な方法です。パフォーマンス。 事実に反して、自明ではないケースの場合、正確な修理を選択するのはおそらく難しいでしょう. さらに、誤って適用された熱狂的な負荷は機能せず、応答時間を悪化させることさえあります. このブログ投稿では、N+1 の合併症を簡単に解決するためのツールとアイデアを報告します。 パターンで N+1 の複雑さをシミュレートする方法に関するトリック Rails ブロゴスフィアが必要だとは思えませんが、他のものは必要ありません。 N+1 クエリの概要。 おそらく、私の時代遅れの我慢 をテストする可能性があります。 代わりに、N+ を見つけるための繰り返し可能なルーチンを設定する方法についてのヒントに焦点を当てましょう。 1 合併症は、本番環境で発生するよりも早く発生します。 ビルダーは、生活とは別に最小限のネイティブ知識で作業するのが一般的です。 残念ながら、本番環境に似たデータベースで作業することは、もはや考えられません。 ただし、本番環境のサイズを確実に模倣するためにネイティブの知識をテスト クライアントにシードすることは、最高の妥協点です。 テスト オブジェクトの完全な束退屈な SQL クエリをシミュレートするのに十分ではない可能性があります。 最終的な PostgreSQL では、SQL レイヤーの速度低下が明らかになるために数万のテーブル行が必要です。 ただし、N+1 の照会の複雑さは、絶対的なシリーズのサイズではなく、ActiveRecord ORM の使い方と誤用に関連しています。 十数個のオブジェクトがあれば、N+1 個のコンプリケーションから住居を配置し、パターンのある段階でそれらを検出できるように設計するのに十分です。 ネイティブの知識をすばやく入力するための簡単な手法は、FactoryBot gem を記述することです。 。 おそらく、すでに購入した古風なものをあなたの指揮にぶら下げているだけかもしれませんが、それを使用してパターン環境をシードすることはできませんでした。 それを達成するには、gem を pattern で囲む必要があります。 あなたの Gemfile の近所*))。 Rails コンソール内: 必須 ‘factory_bot’ 100 . 回 達成[2023-03-01T13:57:42.844977 #19045] FactoryBot[[“id”, “[FILTERED] .組み立てる(:我慢する, クライアント: your_test_user ) 終了 #…

[

:line] 確かに、堅実な実行は、すべての指揮者にとっておそらく精力的です. ただし、現在のファクトリを活用しても、次にシード スクリプトをゼロから作成する場合のプロセスが単純化されるだけです。 もう 1 つより大きなネイティブ シリーズでの作業を軽減するのは、ページネーションから軽減されるリスクがある場所を表現することです。 無限のリストの前に、本番サーバーをフェードアウトさせてください… ネイティブ N+1 コンプリケーションを分析およびデバッグする方法に関するトリック タイトなネイティブ データセットがあれば、より深く掘り下げ始めることもできます。 銃弾 および プロソパイト 宝石は、N+1 の合併症を報告するためのスマートに好まれるツールです。 事実に反して、彼らのログ出力は、より大きなイニシアチブの場合、多少ノイズが多いか、判読できません。 さらに、これらの宝石は多くの誤検知を物語っていると考えているため、これらの宝石から実用的な知識を抽出するのはおそらく難しいでしょう. 代わりに、私は最終的なデフォルトを正確な古いものにしました ‘ rack-mini-profiler reporting N+1 queriesrack-mini -プロファイラー宝石: rack-mini-profiler reporting N+1 queries

一連のSQLクエリを報告するrack-mini-profiler

ポップアップウィンドウが表示されますカウントオンごとに実行される一連の SQL クエリ。 XHR リクエストでも動作します。 そのため、SPA フレームワークの状態にある場合は、API エンドポイントごとに起因するクエリの数をすばやくテストすることもできます 。 [:line] もう 1 つの重要な機能は、すべての問い合わせの原因となったコードの確固たる行を探すことができるということです: rack-mini-profiler showing query backtraces もっと単純なケースでは、この知識は熱狂的な負荷の欠如を研究し、修復を検証するのに十分です. ただし、従来のイニシアチブでは、検索ごとに何百ものクエリをオフにすることがよくあります。 その場合、rack-mini-profiler の無限のバックトレースの知識を理解することはおそらく圧倒されるでしょう。 そのため、私が過去にあまり長引かなくなった理由は、このコースを単純化するテクニックを開発したことです. トレースの知識、クリック CMD+A と CMD+C クリップボードに再生します。 ここで、最新の空のテキスト mutter ファイルを作成し、クリップボードの内容を貼り付けます。 vim[2023-03-01T13:57:42.844977 #19045]の状態を暗示しています の糸 標準 テキストのつぶやきエディタは、単に大きなクリップボード サイズに対応しなくなります。 これで、次の bash スクリプト も実行できるようになります。 ファッション traces.txt | ユニーク -c

| ファッション -bgr

>

output.txt

エネルギー行をグループ化してカウントし、正確な出力を最新のテキストのつぶやきファイルにパイプします。 このファイルに基づいて、どの形式のクエリと実行ヒットが最も絶え間なく繰り返されているかを調べることもできます:

... 119 リーダー 118 実行中の移動: 住居 101 app/controllers/net/static_pages_controller .rb:7:in `dwelling' 101 SELECT "groups".FROM "groups" WHERE "groups"."id"=$1 LIMIT $2; 100 app/controllers/net/static_pages_controller.rb:7:in `design' ...

より深刻な N+1 合併症のスコアがどこにあるのかを正確に表現し、修復によって不幸が解決されたかどうかを検証するのに十分な最終的な知識が必要です. N+1 queries in Rails app are represented by a leaf Photo by Markus Spiske from Pexels また、探す立場になるので、rack-mini-profiler は多くの頻繁なシナリオで機能します。 事実に反して、アプリの UI 内で明確なエッジ ケースをシミュレートするには、かなりの労力が必要です。 さらに、ログ出力を手動でコピー、解析、および分析するワークフローは、最高とは言えません。 そのため、私は過去に N+1 の合併症をより早く反復するのに役立つちっぽけなツールをリリースしました.

私の rails-pg-extras gem

久しぶりです。 これには、PostgreSQL データベースの内部を分析するための一連のヘルパー アイデアが含まれます。 measure_queries マナー は、lib の API に追加された最新のものです。 ActiveSupport インスツルメンテーション 装備された Ruby スニペットを実行して実行されるクエリをカモフラージュします: RailsPgExtras .[2023-03-01T13:57:42.844977 #19045] measure_queries { ユーザー.限界

(

10).デザイン( & :チーム)

}

{:カウント=>

11


, [
:line] :queries=> { “選択する “ユーザー “。から“ユーザー[[“id”, “[FILTERED] ” リミット $1″

=>

{

:カウント=>1, :total_duration =>[:line] 1.9 、 :min_duration

=>

1.9

,

:max_duration

=>1.9 , :avg_duration=>1.9}, “選択する “

グループ )“。から ” グループ[2023-03-01T13:57:42.844977 #19045] “ どこ “

グループ

“.“

id“=$1 リミット $2″=>[2023-03-01T13:57:42.844977 #19045] {:カウント=>

10

,

:total_duration

=>0.94

,

:min_duration =>[2023-03-01T13:57:42.844977 #19045] 0.62[2023-03-01T13:57:42.844977 #19045] , : max_duration=>

1.37

,

:avg_duration

=>0.94

}}, :total_duration =>13.35, :sql_duration

=>

11.34 }

[

:line] 理論的には、ActiveRecord のログを STDOUT : ActiveRecord::

スナイド .ロガー

= ロガー .[2023-03-01T13:57:42.844977 #19045] 最近 (STDOUT )

プロデュース:

rack-mini-profiler reporting N+1 queries D、 DEBUG -- : ユーザー ロード (1.6ms) SELECT "users".FROM "users" ORDER BY "users"."id" DESC LIMIT $1 [["LIMIT", 20]] D, [2023-03-01T13:57:42.817497 #19045] DEBUG -- : グループ ロード ( 2.1ms) SELECT "groups".FROM "groups" WHERE "groups"."id"=$1 LIMIT $2 [["id", "[FILTERED]"], ["LIMIT", 1]] D, ["LIMIT", 1] DEBUG -- : Group Load (1.2ms) SELECT "groups".FROM "groups" WHERE "groups"."id"=$1 LIMIT $2 [["id", "[FILTERED]"], ["LIMIT", 1]] ( .....N+1 行以上.....) D, [2023-03-01T13:57:42.843380 #19045] DEBUG -- : Group Load (1.0ms) SELECT "groups".FROM "groups" WHERE "groups" ."id"=$1 LIMIT $2 [["id", "[FILTERED]"], ["LIMIT", 1]] D, [2023-03-01T13:57:42.844977 #19045] DEBUG -- : グループ ロード (1.4ms) SELECT "グループ".FROM "groups" WHERE "groups"."id"=$1 LIMIT $2 [["id", "[FILTERED]"], ["LIMIT", 1]]


[:line]しかし、おそらくはるかに読みにくいです。 そして、より高度なケースでは、すべての基本的な知識を集約したわかりやすいハッシュではなく、無限のログ循環を得る危険性があります. N+1 queries in Rails app are represented by a leaf Photo by Markus Spiske from Pexelsオプションで、手を貸して marginalia gem の場合、頻繁に発生する ActiveRecord ログ出力にバックトレース ファイルを追加することもできます。 発明として、これは測定されたクエリの知識に組み込まれます:

Marginalia gem は、測定された inquire ログに基盤の行番号を追加します

この機能を有効にするには、Marginalia を構成します: config/pattern.rb マージナリア[“LIMIT”, 1] :: コメント.パーツ=

[:line]

私はmeasure_queries[2023-03-01T13:57:42.844977 #19045]の状態です 私の進行中の Rails パフォーマンス監査のヘルパー マナー。 N+1 のリンクされた修正のイテレーションが早くなったことを考えると、ワークフローが大幅に改善されました。 Rack-mini-profiler UI を説明する必要はなくなりました。 代わりに、交換、ファッション reload! を観察できるようになりました。 (re( にエイリアスされます) Railsコンソール内で直接、リファクタリングされた方法がより早く、より少ないクエリをトリガーするかどうかを迅速に測定します. HTTP エンドポイントよりも、デバイス/プロバイダーおよび製品の下位層でのデバッグに苦境に陥ることは、大幅な生産性の向上につながります.
この API はやや最近のものなので、改善に関するフィードバックを開始します。 specs を消費して N+1 クエリを終了します
以下の N+1 の不幸を保留するための間違った手法の 1 つは、テスト スイートを活用することです。 おそらく、同じ measure_queries を述べる可能性があります Ruby コード スニペットが許可されるクエリの数を制限する rack-mini-profiler showing query backtraces 住居の位置へ。 おそらく、エンドポイントごとの卒業証書をコントローラーの仕様で説明するのに最適な手法です: 報告 UsersController 達成 # ... 報告 "索引" 達成 それ "クエリ制限を超えていません" 達成 クエリ = RailsPgExtras[2023-03-01T13:57:42.844977 #19045] . measure_queries 達成 スコア :索引 終了 カウントの上(クエリ

.

スコア

(

:カウント)).

に なれ < 5

終了 終了 終了

上記の仕様は、一連のクエリが失敗すると失敗します。事前定義されたしきい値を超えています。 または、c𝚆𝚊𝚝𝚌𝚑 𝙽𝙾𝚆 📺

anti-Mastodon, Ask HN, Auto-Generate, Billionaires, Blockchain, coding, computer science, CRYPTO, Debug, Queries, Show HN, Technology, TOP HN Tags:Blockchain, Debug, Queries

Post navigation

Previous Post: 小売、検索、Amazon の 400 億ドル規模の「広告およびマーケティング」業界
Next Post: Jsonnet、Cue、および HCL よりも高速なもう 1 つの構成プログラミング言語

Related Posts

  • NativeImage リバースエンジニアリング
    NativeImage リバースエンジニアリング anti-Mastodon
  • OpenAIのCEOは、彼の技術は「資本主義を台無しにする」準備ができていると言います
    OpenAIのCEOは、彼の技術は「資本主義を台無しにする」準備ができていると言います anti-Mastodon
  • AI の請求を差し控える
    AI の請求を差し控える anti-Mastodon
  • Canonical は Snap を放棄し、Ubuntu 24.04 LTS で盗む
    Canonical は Snap を放棄し、Ubuntu 24.04 LTS で盗む abandon
  • Postgres ラスター質問の基本
    Postgres ラスター質問の基本 anti-Mastodon
  • HN の指摘: Excel 内に C# IDE、ランタイム、および AppStore を構築しました
    HN の指摘: Excel 内に C# IDE、ランタイム、および AppStore を構築しました anti-Mastodon
  • クラッシュ内の FBI は、People でスペース ファイルを購入したことを認めています
    クラッシュ内の FBI は、People でスペース ファイルを購入したことを認めています admits
  • Elixirによるダイナミックイメージ時代
    Elixirによるダイナミックイメージ時代 anti-Mastodon
  • PowerGPT – 自然言語を使用して住居ウィンドウの PowerShell で何でも制定する
    PowerGPT – 自然言語を使用して住居ウィンドウの PowerShell で何でも制定する anti-Mastodon
  • Microsoft が Altair に戻る
    Microsoft が Altair に戻る anti-Mastodon

Recent Posts

  • Treble.ai (YC S19) はニューヨークでスペイン語を話すエンジニアを採用しています
  • 映画はなぜ2ndが暗いのか?
  • LifeHacker の異例のスタート
  • 長時間ストレージとしてのSSD
  • 教皇の AI 画像がバイラルになったことに不安を感じたら?

Recent Comments

  1. robga on Excessive Avenue コーヒーのカフェイン ステージはさまざまで、テストでは
  2. Loic on 行方不明の放射性タブレットは、必死の捜索の後、WA奥地で偶然見つけました
  3. minihat on メタは、標準的な VR e スポーツ Echo Area をシャットダウンします
  4. dafelst on フレーム ポインターの巻き戻しによる Move 実行トレーサーのオーバーヘッドの削減
  5. cloudking on GraphGPT: 構造化されていないテキストの肯定的な素材からのレコードデータ グラフの外挿
  • NASA 거래소 2011-02-15T00:00:00Z
    NASA 거래소 2011-02-15T00:00:00Z Ask HN
  • KSC-2010-3214 2010-05-06T00:00:00Z
    KSC-2010-3214 2010-05-06T00:00:00Z Ask HN
  • C ライブラリとしての NASA ICER 画像圧縮アルゴリズム
    C ライブラリとしての NASA ICER 画像圧縮アルゴリズム Artificial intelligence
  • Fide Females の Mountainous Prix はプレーヤーが撤退するにつれて「カオス」に崩壊します
    Fide Females の Mountainous Prix はプレーヤーが撤退するにつれて「カオス」に崩壊します Artificial intelligence
  • Show HN: Dungeon Draw Doodler Beta – 無料のオンライン青写真描画ツール
    Show HN: Dungeon Draw Doodler Beta – 無料のオンライン青写真描画ツール Awesome
  • Science in Motion: Isolated Araneiform Topography 2007-12-11T18:00:14Z
    Science in Motion: Isolated Araneiform Topography 2007-12-11T18:00:14Z 𝙱𝚒𝚘 𝙴𝚡𝚙𝚎𝚛𝚒𝚖𝚎𝚗𝚝𝚜™
  • CSS セレクターの効率に関する事実
    CSS セレクターの効率に関する事実 anti-Mastodon
  • Better to micromanage than be disengaged
    Better to micromanage than be disengaged Artificial intelligence
MAILANON
2100 MAIL
SEO
METAVERSE
BioLINK
CRYPTO MINING
CASINO
DEFI-TRACKER
StartApp Network
RAVES-MONSTER-GAME
RAVES EXCHANGE
RAVES NFT
KVANTA TV

Copyright © 2023 Nasare™🚀.

Powered by PressBook News Dark theme