[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:database\u002Fpg-query-planning":4,"config":215},null,{"field_key":5,"field_name":6,"seniority":7,"topic_key":8,"topic_name":9,"spec_key":7,"spec_name":7,"locale":10,"cell_total":11,"field_total":12,"seniorities":13,"topics":17,"specs":115,"samples":129},"database","Database","","pg-query-planning","Pg Query Planning","en",75,2475,[14,15,16],"junior","mid","senior",[18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,79,82,85,88,91,94,97,100,103,106,109,112],{"key":19,"name":20,"count":11},"backup-recovery","Backup Recovery",{"key":22,"name":23,"count":11},"data-modeling","Data Modeling",{"key":25,"name":26,"count":11},"indexing","Indexing",{"key":28,"name":29,"count":11},"mongodb-aggregation","Mongodb Aggregation",{"key":31,"name":32,"count":11},"mongodb-indexes-queries","Mongodb Indexes Queries",{"key":34,"name":35,"count":11},"mongodb-operations","Mongodb Operations",{"key":37,"name":38,"count":11},"mongodb-replication-sharding","Mongodb Replication Sharding",{"key":40,"name":41,"count":11},"mongodb-schema-modeling","Mongodb Schema Modeling",{"key":43,"name":44,"count":11},"mongodb-transactions-consistency","Mongodb Transactions Consistency",{"key":46,"name":47,"count":11},"mysql-indexes","Mysql Indexes",{"key":49,"name":50,"count":11},"mysql-innodb-transactions","Mysql Innodb Transactions",{"key":52,"name":53,"count":11},"mysql-operations","Mysql Operations",{"key":55,"name":56,"count":11},"mysql-query-optimization","Mysql Query Optimization",{"key":58,"name":59,"count":11},"mysql-replication-scaling","Mysql Replication Scaling",{"key":61,"name":62,"count":11},"mysql-types-constraints","Mysql Types Constraints",{"key":64,"name":65,"count":11},"nosql-models","Nosql Models",{"key":67,"name":68,"count":11},"performance-tuning","Performance Tuning",{"key":70,"name":71,"count":11},"pg-indexes","Pg Indexes",{"key":73,"name":74,"count":11},"pg-mvcc-vacuum","Pg Mvcc Vacuum",{"key":76,"name":77,"count":11},"pg-operations","Pg Operations",{"key":8,"name":9,"count":11},{"key":80,"name":81,"count":11},"pg-transactions-locking","Pg Transactions Locking",{"key":83,"name":84,"count":11},"pg-types-constraints","Pg Types Constraints",{"key":86,"name":87,"count":11},"query-optimization","Query Optimization",{"key":89,"name":90,"count":11},"redis-cluster-sharding","Redis Cluster Sharding",{"key":92,"name":93,"count":11},"redis-data-structures","Redis Data Structures",{"key":95,"name":96,"count":11},"redis-expiration-eviction","Redis Expiration Eviction",{"key":98,"name":99,"count":11},"redis-persistence","Redis Persistence",{"key":101,"name":102,"count":11},"redis-replication-sentinel","Redis Replication Sentinel",{"key":104,"name":105,"count":11},"redis-transactions-scripting","Redis Transactions Scripting",{"key":107,"name":108,"count":11},"replication-scaling","Replication Scaling",{"key":110,"name":111,"count":11},"security-access","Security Access",{"key":113,"name":114,"count":11},"transactions-isolation","Transactions Isolation",[116,120,123,126],{"key":117,"name":118,"count":119},"mongodb","MongoDB",450,{"key":121,"name":122,"count":119},"mysql","MySQL",{"key":124,"name":125,"count":119},"postgresql","PostgreSQL",{"key":127,"name":128,"count":119},"redis","Redis",[130,148,162,176,189,202],{"id":131,"topic":9,"difficulty":132,"body":133,"options":134,"correct_key":136,"explanation":147},"019f5d67-ffb1-7727-81b8-6f27bcca0b8f",1,"A developer runs `EXPLAIN` on a `SELECT` query, then runs `EXPLAIN ANALYZE` on the exact same query. What is the core difference between the two?",[135,138,141,144],{"key":136,"text":137},"a","EXPLAIN shows only the estimated plan; EXPLAIN ANALYZE actually runs the query and adds real timings",{"key":139,"text":140},"b","EXPLAIN ANALYZE just formats the same plan more readably; neither one runs the query",{"key":142,"text":143},"c","EXPLAIN runs the query and returns its result rows, while EXPLAIN ANALYZE only shows the estimated plan",{"key":145,"text":146},"d","Both run the query the same way; the only difference is whether the output is JSON or plain text","`EXPLAIN` asks the planner for a plan and shows its cost\u002Frow estimates without executing anything. `EXPLAIN ANALYZE` actually executes the statement, then annotates each node with real elapsed time and real row counts alongside the estimates, so you can compare estimate vs. reality. Neither (b) nor (c) matches this, and (d) ignores that EXPLAIN alone never executes the query.",{"id":149,"topic":9,"difficulty":150,"body":151,"options":152,"correct_key":139,"explanation":161},"019f5d67-ffb2-7413-8cf9-f459e2bc4e16",2,"A teammate wants to see the real execution plan of `UPDATE orders SET status = 'paid' WHERE customer_id = 42;` so they run `EXPLAIN ANALYZE` directly on it against the live database. What actually happens?",[153,155,157,159],{"key":136,"text":154},"PostgreSQL detects the statement is a write and silently downgrades it to a read-only plan estimate",{"key":139,"text":156},"The UPDATE runs and commits as usual; EXPLAIN ANALYZE does not roll it back on its own",{"key":142,"text":158},"PostgreSQL refuses with a syntax error, since EXPLAIN ANALYZE only accepts SELECT statements",{"key":145,"text":160},"The rows are locked for the duration of the EXPLAIN but no write is ever applied to the table","`EXPLAIN ANALYZE` executes the statement for real to gather actual timings and row counts — for `UPDATE`\u002F`DELETE`\u002F`INSERT` this means the data is really changed and, absent an explicit transaction, committed immediately. It is not read-only (a), it is valid syntax for DML (c), and it is not a lock-only dry run (d). To inspect the plan of a write safely, wrap it in `BEGIN; ... ROLLBACK;`.",{"id":163,"topic":9,"difficulty":164,"body":165,"options":166,"correct_key":142,"explanation":175},"019f5d67-ffb2-7e3e-b33d-37bee141a157",3,"You need to see the real `EXPLAIN ANALYZE` plan for `DELETE FROM orders WHERE status = 'cancelled';` on a table with real data, without permanently losing those rows. Real run: before the DELETE `status = 'cancelled'` had 50000 rows; right after `EXPLAIN ANALYZE DELETE ...` it had 0; after issuing `ROLLBACK`, it was back to 50000. Which approach was used?",[167,169,171,173],{"key":136,"text":168},"Running `EXPLAIN` instead of `EXPLAIN ANALYZE`, since EXPLAIN alone never touches data",{"key":139,"text":170},"Taking a full table backup first, running the DELETE, then restoring the backup afterward",{"key":142,"text":172},"Open a transaction, run `EXPLAIN ANALYZE DELETE ...` inside it, then ROLLBACK instead of COMMIT",{"key":145,"text":174},"Running the DELETE on a read replica, since replicas allow EXPLAIN ANALYZE to be non-destructive","`EXPLAIN ANALYZE` on a `DELETE` truly deletes the rows; the only safe way to inspect the real plan without keeping the change is `BEGIN; EXPLAIN ANALYZE DELETE ...; ROLLBACK;` — the statement runs for real inside the transaction (so the plan and timings are genuine) and the rollback undoes the effect. (a) would give no real timings\u002Factual rows at all. (b) works but is a needlessly heavy detour compared to a transaction. (d) is wrong because a read replica does not accept write statements.",{"id":177,"topic":9,"difficulty":132,"body":178,"options":179,"correct_key":145,"explanation":188},"019f5d67-ffb3-77b7-ba8f-372d34e156bd","In an `EXPLAIN` line such as `Seq Scan on orders  (cost=0.00..3627.00 rows=200000 width=32)`, what does the `cost=0.00..3627.00` part represent?",[180,182,184,186],{"key":136,"text":181},"The minimum and maximum number of milliseconds the query actually took to run",{"key":139,"text":183},"The percentage of the query's total CPU time this node is expected to consume",{"key":142,"text":185},"The estimated number of disk blocks that will be read from and written to for this node",{"key":145,"text":187},"The planner's arbitrary cost units for startup and total cost, not a time measurement","`cost=startup..total` is expressed in the planner's own arbitrary cost units (derived from settings like `seq_page_cost`\u002F`cpu_tuple_cost`), used only to compare candidate plans against each other. It is never a millisecond value (a), a CPU percentage (b), or a block read\u002Fwrite count (c) — those require `EXPLAIN ANALYZE` with `BUFFERS`\u002Factual timings instead.",{"id":190,"topic":9,"difficulty":150,"body":191,"options":192,"correct_key":139,"explanation":201},"019f5d67-ffb4-71a1-baca-7b6485ba3cef","Real plan from `pgscratch`:\n```\nIndex Scan using orders_pkey on orders  (cost=0.42..8.44 rows=1 width=32)\n  Index Cond: (id = 42)\n```\nWhat do the two numbers `0.42` and `8.44` in `cost=0.42..8.44` mean, in order?",[193,195,197,199],{"key":136,"text":194},"8.44 is the cost of finding the first row, 0.42 is the cost of returning every row",{"key":139,"text":196},"0.42 is the estimated cost to reach the first row; 8.44 is the estimated cost for all rows",{"key":142,"text":198},"0.42 is the number of index pages read, 8.44 is the number of heap pages read",{"key":145,"text":200},"0.42 is the cost before ANALYZE was run, 8.44 is the cost after ANALYZE was run","`cost=X..Y` is always `startup_cost..total_cost`: X is the estimated cost before the node can produce its very first output row, Y is the estimated cost to produce all of the node's output. For this single-row `Index Cond` lookup both numbers are naturally small. (a) reverses the order, (c) confuses cost units with page counts, and (d) invents an ANALYZE-before\u002Fafter meaning that cost= does not carry.",{"id":203,"topic":9,"difficulty":150,"body":204,"options":205,"correct_key":136,"explanation":214},"019f5d67-ffb4-79c9-aa05-ac445db6b02f","Real plan for `SELECT * FROM orders WHERE status = 'paid';` on a 200,000-row `orders` table (an `orders_status_idx` index exists on `status`):\n```\nBitmap Heap Scan on orders  (cost=556.13..2802.22 rows=49527 width=32)\n  Recheck Cond: (status = 'paid'::text)\n  ->  Bitmap Index Scan on orders_status_idx  (cost=0.00..543.75 rows=49527 width=0)\n        Index Cond: (status = 'paid'::text)\n```\nWithout running `EXPLAIN ANALYZE`, what does `rows=49527` on the `Bitmap Heap Scan` line represent?",[206,208,210,212],{"key":136,"text":207},"The planner's estimate from table statistics of matching rows — not a measured count",{"key":139,"text":209},"The exact, already-measured number of rows that matched when this EXPLAIN was generated",{"key":142,"text":211},"The total number of rows in the `orders` table, regardless of the WHERE clause",{"key":145,"text":213},"The maximum number of rows PostgreSQL will return before applying an implicit LIMIT","Plain `EXPLAIN` (no ANALYZE) never executes the query, so every `rows=` value on every node — including this one — is purely a planner estimate derived from column statistics (most-common-values, histogram, etc.), not a measured value. To see the real, executed row count you need `EXPLAIN ANALYZE`, where it appears as `actual rows=...`. (b) mislabels this as measured, (c) confuses it with the table's total row count (200,000), and (d) invents a LIMIT that isn't in the query.",{"fields":216,"seniorities":391,"interview_shapes":392,"locales":397,"oauth":399,"question_count":402,"coach_enabled":403,"jd_match_enabled":403},[217,242,262,278,302,315,324,343,365,372,378,385],{"key":218,"name_tr":219,"name_en":219,"sort":132,"specializations":220},"backend","Backend",[221,224,227,230,233,236,239],{"key":222,"name":223,"field":218},"general","Genel",{"key":225,"name":226,"field":218},"go","Go",{"key":228,"name":229,"field":218},"python","Python",{"key":231,"name":232,"field":218},"java","Java",{"key":234,"name":235,"field":218},"csharp","C#\u002F.NET",{"key":237,"name":238,"field":218},"nodejs","Node.js",{"key":240,"name":241,"field":218},"php","PHP",{"key":243,"name_tr":244,"name_en":244,"sort":150,"specializations":245},"frontend","Frontend",[246,247,250,253,256,259],{"key":222,"name":223,"field":243},{"key":248,"name":249,"field":243},"javascript","JavaScript",{"key":251,"name":252,"field":243},"typescript","TypeScript",{"key":254,"name":255,"field":243},"react","React",{"key":257,"name":258,"field":243},"vue","Vue",{"key":260,"name":261,"field":243},"angular","Angular",{"key":263,"name_tr":264,"name_en":264,"sort":164,"specializations":265},"fullstack","Fullstack",[266,267,268,269,270,271,272,273,274,275,276,277],{"key":222,"name":223,"field":263},{"key":225,"name":226,"field":218},{"key":228,"name":229,"field":218},{"key":231,"name":232,"field":218},{"key":234,"name":235,"field":218},{"key":237,"name":238,"field":218},{"key":240,"name":241,"field":218},{"key":248,"name":249,"field":243},{"key":251,"name":252,"field":243},{"key":254,"name":255,"field":243},{"key":257,"name":258,"field":243},{"key":260,"name":261,"field":243},{"key":279,"name_tr":280,"name_en":280,"sort":281,"specializations":282},"devops-cloud","DevOps \u002F Cloud",4,[283,284,287,290,293,296,299],{"key":222,"name":223,"field":279},{"key":285,"name":286,"field":279},"aws","AWS",{"key":288,"name":289,"field":279},"gcp","GCP",{"key":291,"name":292,"field":279},"azure","Azure",{"key":294,"name":295,"field":279},"kubernetes","Kubernetes",{"key":297,"name":298,"field":279},"terraform","Terraform",{"key":300,"name":301,"field":279},"linux","Linux",{"key":303,"name_tr":304,"name_en":304,"sort":305,"specializations":306},"ai-engineer","AI Engineer",5,[307,308,309,312],{"key":222,"name":223,"field":303},{"key":228,"name":229,"field":303},{"key":310,"name":311,"field":303},"llm-rag","LLM\u002FRAG",{"key":313,"name":314,"field":303},"mlops","MLOps",{"key":5,"name_tr":316,"name_en":6,"sort":317,"specializations":318},"Veritabanı",6,[319,320,321,322,323],{"key":222,"name":223,"field":5},{"key":124,"name":125,"field":5},{"key":121,"name":122,"field":5},{"key":117,"name":118,"field":5},{"key":127,"name":128,"field":5},{"key":325,"name_tr":326,"name_en":327,"sort":328,"specializations":329},"mobile","Mobil","Mobile",7,[330,331,334,337,340],{"key":222,"name":223,"field":325},{"key":332,"name":333,"field":325},"ios-swift","iOS (Swift)",{"key":335,"name":336,"field":325},"android-kotlin","Android (Kotlin)",{"key":338,"name":339,"field":325},"flutter","Flutter",{"key":341,"name":342,"field":325},"react-native","React Native",{"key":344,"name_tr":345,"name_en":346,"sort":347,"specializations":348},"security","Güvenlik","Security",8,[349,350,353,356,359,362],{"key":222,"name":223,"field":344},{"key":351,"name":352,"field":344},"appsec","AppSec",{"key":354,"name":355,"field":344},"offensive-pentest","Offensive \u002F Pentest",{"key":357,"name":358,"field":344},"cloud-security","Cloud Security",{"key":360,"name":361,"field":344},"devsecops","DevSecOps",{"key":363,"name":364,"field":344},"blue-team-incident","Blue Team \u002F Incident",{"key":366,"name_tr":367,"name_en":368,"sort":369,"specializations":370},"qa-test-automation","QA \u002F Test Otomasyonu","QA \u002F Test Automation",9,[371],{"key":222,"name":223,"field":366},{"key":373,"name_tr":374,"name_en":374,"sort":375,"specializations":376},"data-engineer","Data Engineer",10,[377],{"key":222,"name":223,"field":373},{"key":379,"name_tr":380,"name_en":381,"sort":382,"specializations":383},"game-dev","Oyun Geliştirme","Game Development",11,[384],{"key":222,"name":223,"field":379},{"key":386,"name_tr":387,"name_en":387,"sort":388,"specializations":389},"ml-engineer","ML Engineer",12,[390],{"key":222,"name":223,"field":386},[14,15,16],{"junior":393,"mid":395,"senior":396},{"questions":394,"median_sec":3},20,{"questions":394,"median_sec":3},{"questions":394,"median_sec":3},[398,10],"tr",[400,401],"google","github",21750,true]