<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://knowledgebase.pirho.net/index.php?action=history&amp;feed=atom&amp;title=How_Database_Queries_Really_Work</id>
	<title>How Database Queries Really Work - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://knowledgebase.pirho.net/index.php?action=history&amp;feed=atom&amp;title=How_Database_Queries_Really_Work"/>
	<link rel="alternate" type="text/html" href="https://knowledgebase.pirho.net/index.php?title=How_Database_Queries_Really_Work&amp;action=history"/>
	<updated>2026-07-11T12:51:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://knowledgebase.pirho.net/index.php?title=How_Database_Queries_Really_Work&amp;diff=411&amp;oldid=prev</id>
		<title>Dex: Created page with &quot;&#039;&#039;&#039;Summary:&#039;&#039;&#039; A practical explanation of how database engines locate, filter, and return information. Rather than focusing on SQL syntax, this article explores what happens inside a database when a query is executed, from simple record scanning through to indexes, query planners, and modern optimisation techniques.  == Context ==  === The Natural Assumption === Why most people imagine databases simply reading every record.  === The Sieve Analogy === Understanding querie...&quot;</title>
		<link rel="alternate" type="text/html" href="https://knowledgebase.pirho.net/index.php?title=How_Database_Queries_Really_Work&amp;diff=411&amp;oldid=prev"/>
		<updated>2026-07-05T14:09:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Summary:&amp;#039;&amp;#039;&amp;#039; A practical explanation of how database engines locate, filter, and return information. Rather than focusing on SQL syntax, this article explores what happens inside a database when a query is executed, from simple record scanning through to indexes, query planners, and modern optimisation techniques.  == Context ==  === The Natural Assumption === Why most people imagine databases simply reading every record.  === The Sieve Analogy === Understanding querie...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Summary:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A practical explanation of how database engines locate, filter, and return information. Rather than focusing on SQL syntax, this article explores what happens inside a database when a query is executed, from simple record scanning through to indexes, query planners, and modern optimisation techniques.&lt;br /&gt;
&lt;br /&gt;
== Context ==&lt;br /&gt;
&lt;br /&gt;
=== The Natural Assumption ===&lt;br /&gt;
Why most people imagine databases simply reading every record.&lt;br /&gt;
&lt;br /&gt;
=== The Sieve Analogy ===&lt;br /&gt;
Understanding queries as records passing through progressively finer filters.&lt;br /&gt;
&lt;br /&gt;
== Core Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== Records, Tables and Predicates ===&lt;br /&gt;
What a query is actually asking for.&lt;br /&gt;
&lt;br /&gt;
=== The Full Table Scan ===&lt;br /&gt;
The simplest possible query engine.&lt;br /&gt;
&lt;br /&gt;
=== Why Full Scans Become Expensive ===&lt;br /&gt;
CPU, memory and storage considerations.&lt;br /&gt;
&lt;br /&gt;
== Indexes: Moving the Sieve Closer to the Data ==&lt;br /&gt;
&lt;br /&gt;
=== B-Tree Indexes ===&lt;br /&gt;
How databases avoid examining every record.&lt;br /&gt;
&lt;br /&gt;
=== Hash Indexes ===&lt;br /&gt;
Optimised equality lookups.&lt;br /&gt;
&lt;br /&gt;
=== Inverted Indexes ===&lt;br /&gt;
How text search works.&lt;br /&gt;
&lt;br /&gt;
=== Bitmap Indexes ===&lt;br /&gt;
Filtering large datasets efficiently.&lt;br /&gt;
&lt;br /&gt;
== Query Planning ==&lt;br /&gt;
&lt;br /&gt;
=== One Query, Many Possible Paths ===&lt;br /&gt;
Why databases must make decisions.&lt;br /&gt;
&lt;br /&gt;
=== Selectivity ===&lt;br /&gt;
Finding the most restrictive filter first.&lt;br /&gt;
&lt;br /&gt;
=== Predicate Pushdown ===&lt;br /&gt;
Applying filters as early as possible.&lt;br /&gt;
&lt;br /&gt;
=== Cost-Based Optimisation ===&lt;br /&gt;
Estimating the cheapest route to an answer.&lt;br /&gt;
&lt;br /&gt;
== Storage Engine Considerations ==&lt;br /&gt;
&lt;br /&gt;
=== Row-Oriented Storage ===&lt;br /&gt;
&lt;br /&gt;
=== Column-Oriented Storage ===&lt;br /&gt;
&lt;br /&gt;
=== Why Analytics Databases Feel Faster ===&lt;br /&gt;
&lt;br /&gt;
== Modern Optimisations ==&lt;br /&gt;
&lt;br /&gt;
=== Block Elimination ===&lt;br /&gt;
&lt;br /&gt;
=== Zone Maps ===&lt;br /&gt;
&lt;br /&gt;
=== Bloom Filters ===&lt;br /&gt;
&lt;br /&gt;
=== Vectorised Execution ===&lt;br /&gt;
&lt;br /&gt;
=== Parallel Query Processing ===&lt;br /&gt;
&lt;br /&gt;
== Practical Application ==&lt;br /&gt;
&lt;br /&gt;
=== Building Your Own Query Engine ===&lt;br /&gt;
&lt;br /&gt;
=== A Sensible Evolution Path ===&lt;br /&gt;
* Full scan&lt;br /&gt;
* Indexed lookup&lt;br /&gt;
* Query planner&lt;br /&gt;
* Block skipping&lt;br /&gt;
* Vectorisation&lt;br /&gt;
&lt;br /&gt;
== Common Misconceptions ==&lt;br /&gt;
&lt;br /&gt;
=== Databases Are Not Magic ===&lt;br /&gt;
&lt;br /&gt;
=== SQL Is Not the Query Engine ===&lt;br /&gt;
&lt;br /&gt;
=== Indexes Do Not Eliminate Filtering ===&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Architecture Considerations ==&lt;br /&gt;
&lt;br /&gt;
=== Read Optimisation versus Write Optimisation ===&lt;br /&gt;
&lt;br /&gt;
=== Choosing the Right Indexes ===&lt;br /&gt;
&lt;br /&gt;
=== Storage Layout Matters ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The Goal Is Not Faster Filtering&lt;br /&gt;
&lt;br /&gt;
The Goal Is Filtering Less&lt;/div&gt;</summary>
		<author><name>Dex</name></author>
	</entry>
</feed>