<s>
BRIN	O
indexes	O
provide	O
similar	O
benefits	O
to	O
horizontal	B-General_Concept
partitioning	I-General_Concept
or	O
sharding	B-General_Concept
but	O
without	O
needing	O
to	O
explicitly	O
declare	O
partitions	O
.	O
</s>
<s>
A	O
BRIN	O
is	O
applicable	O
to	O
an	O
index	O
on	O
a	O
table	B-Application
that	O
is	O
large	O
and	O
where	O
the	O
index	O
key	O
value	O
is	O
easily	O
sorted	O
and	O
evaluated	O
with	O
a	O
MinMax	O
function	O
.	O
</s>
<s>
Implementations	O
thus	O
far	O
are	O
tightly	O
coupled	O
to	O
internal	O
implementation	O
and	O
storage	O
techniques	O
for	O
the	O
database	B-Application
tables	I-Application
.	O
</s>
<s>
So	O
far	O
PostgreSQL	B-Application
is	O
the	O
only	O
vendor	O
to	O
have	O
announced	O
a	O
live	O
product	O
with	O
this	O
specific	O
feature	O
,	O
in	O
PostgreSQL9.5	O
.	O
</s>
<s>
Other	O
vendors	O
have	O
described	O
some	O
similar	O
features	O
,	O
including	O
Oracle	B-Application
,	O
Netezza	O
'	O
zone	O
maps	O
 '	O
,	O
Infobright	O
'	O
data	O
packs	O
 '	O
,	O
MonetDB	B-Application
and	O
Apache	B-General_Concept
Hive	I-General_Concept
with	O
ORC/Parquet	O
.	O
</s>
<s>
Data	O
storage	O
in	O
large	O
databases	O
is	O
layered	O
and	O
chunked	O
,	O
with	O
the	O
table	B-Application
storage	O
arranged	O
into	O
'	O
blocks	O
 '	O
.	O
</s>
<s>
BRIN	O
are	O
a	O
lightweight	O
in-memory	O
summary	O
layer	O
above	O
this	O
:	O
each	O
tuple	O
in	O
the	O
index	O
summarises	O
one	O
block	O
as	O
to	O
the	O
range	O
of	O
the	O
data	O
contained	O
therein	O
:	O
its	O
minimum	O
and	O
maximum	O
values	O
,	O
and	O
if	O
the	O
block	O
contains	O
any	O
non-null	O
data	O
for	O
the	O
column(s )	O
of	O
interest	O
.	O
</s>
<s>
Unlike	O
a	O
traditional	O
index	O
which	O
locates	O
the	O
regions	O
of	O
the	O
table	B-Application
containing	O
values	O
of	O
interest	O
,	O
BRIN	O
act	O
as	O
"	O
negative	O
indexes	O
"	O
,	O
showing	O
the	O
blocks	O
that	O
are	O
definitely	O
not	O
of	O
interest	O
and	O
thus	O
do	O
not	O
need	O
to	O
be	O
processed	O
further	O
.	O
</s>
<s>
Some	O
simple	O
benchmarks	O
suggest	O
a	O
five-fold	O
improvement	O
in	O
search	O
performance	O
with	O
an	O
index	O
scan	O
,	O
compared	O
to	O
the	O
unindexed	O
table	B-Application
.	O
</s>
<s>
Compared	O
to	O
B-trees	B-Architecture
,	O
they	O
avoid	O
their	O
maintenance	O
overhead	O
.	O
</s>
<s>
The	O
same	O
may	O
not	O
be	O
true	O
of	O
B-tree	B-Architecture
:	O
B-tree	B-Architecture
requires	O
a	O
tree	O
node	O
for	O
every	O
approximately	O
N	O
rows	O
in	O
the	O
table	B-Application
,	O
where	O
N	O
is	O
the	O
capacity	O
of	O
a	O
single	O
node	O
,	O
thus	O
the	O
index	O
size	O
is	O
large	O
.	O
</s>
<s>
For	O
a	O
'	O
narrow	O
 '	O
table	B-Application
the	O
B-tree	B-Architecture
index	O
volume	O
approaches	O
that	O
of	O
the	O
table	B-Application
itself	O
;	O
the	O
BRIN	O
may	O
be	O
only	O
5-15	O
%	O
of	O
it	O
.	O
</s>
<s>
A	O
large	O
database	B-Data_Structure
index	I-Data_Structure
would	O
typically	O
use	O
B-tree	B-Architecture
algorithms	O
.	O
</s>
<s>
BRIN	O
is	O
not	O
always	O
a	O
substitute	O
for	O
B-tree	B-Architecture
,	O
it	O
is	O
an	O
improvement	O
on	O
sequential	O
scanning	O
of	O
an	O
index	O
,	O
with	O
particular	O
(	O
and	O
potentially	O
large	O
)	O
advantages	O
when	O
the	O
index	O
meets	O
particular	O
conditions	O
for	O
being	O
ordered	O
and	O
for	O
the	O
search	O
target	O
to	O
be	O
a	O
narrow	O
set	O
of	O
these	O
values	O
.	O
</s>
<s>
In	O
the	O
general	O
case	O
,	O
with	O
random	O
data	O
,	O
B-tree	B-Architecture
may	O
still	O
be	O
superior	O
.	O
</s>
<s>
A	O
particular	O
advantage	O
of	O
the	O
BRIN	O
technique	O
,	O
shared	O
with	O
Oracle	B-Device
Exadata	I-Device
's	O
Smart	O
Scanning	O
,	O
is	O
in	O
the	O
use	O
of	O
this	O
type	O
of	O
index	O
with	O
Big	B-Application
Data	I-Application
or	O
data	O
warehousing	O
applications	O
,	O
where	O
it	O
is	O
known	O
that	O
almost	O
all	O
of	O
the	O
table	B-Application
is	O
irrelevant	O
to	O
the	O
range	O
of	O
interest	O
.	O
</s>
<s>
BRIN	O
allows	O
the	O
table	B-Application
to	O
be	O
queried	O
in	O
such	O
cases	O
by	O
only	O
retrieving	O
blocks	O
that	O
may	O
contain	O
data	O
of	O
interest	O
and	O
excluding	O
those	O
which	O
are	O
clearly	O
outside	O
the	O
range	O
,	O
or	O
contain	O
no	O
data	O
for	O
this	O
column	O
.	O
</s>
<s>
With	O
BRIN	O
,	O
the	O
slowdown	O
from	O
maintaining	O
the	O
index	O
is	O
much	O
reduced	O
compared	O
to	O
B-tree	B-Architecture
.	O
</s>
<s>
Wong	O
reports	O
that	O
B-tree	B-Architecture
slowed	O
down	O
additions	O
to	O
an	O
unindexed	O
10GB	O
table	B-Application
by	O
85%	O
,	O
but	O
a	O
comparable	O
BRIN	O
only	O
had	O
an	O
overhead	O
of	O
11%	O
.	O
</s>
<s>
BRIN	O
may	O
be	O
created	O
for	O
extremely	O
large	O
data	O
where	O
B-tree	B-Architecture
would	O
require	O
horizontal	B-General_Concept
partitioning	I-General_Concept
.	O
</s>
<s>
Creating	O
the	O
BRIN	O
is	O
also	O
much	O
faster	O
than	O
for	O
a	O
B-tree	B-Architecture
,	O
by	O
80%	O
.	O
</s>
<s>
Multiple	O
BRIN	O
may	O
be	O
defined	O
for	O
different	O
columns	O
on	O
a	O
single	O
table	B-Application
.	O
</s>
<s>
In	O
the	O
simplest	O
case	O
,	O
this	O
could	O
require	O
the	O
physical	O
ordering	O
of	O
the	O
table	B-Application
,	O
which	O
is	O
often	O
the	O
creation	O
order	O
of	O
the	O
rows	O
within	O
it	O
,	O
to	O
match	O
the	O
key	O
's	O
order	O
.	O
</s>
<s>
In	O
most	O
cases	O
,	O
BRIN	O
is	O
restricted	O
to	O
a	O
single	O
index	O
per	O
table	B-Application
.	O
</s>
<s>
If	O
two	O
(	O
or	O
more	O
)	O
indexes	O
have	O
similar	O
ordering	O
behaviour	O
,	O
it	O
may	O
be	O
possible	O
and	O
useful	O
to	O
define	O
multiple	O
BRIN	O
on	O
the	O
same	O
table	B-Application
.	O
</s>
<s>
BRIN	O
have	O
some	O
similarities	O
to	O
Oracle	B-Device
Exadata	I-Device
"	O
Storage	B-Operating_System
Indexes	I-Operating_System
"	O
.	O
</s>
<s>
Exadata	B-Device
has	O
the	O
strong	O
concept	O
of	O
a	O
'	O
storage	O
layer	O
 '	O
in	O
its	O
architecture	O
stack	O
.	O
</s>
<s>
Table	B-Application
data	O
is	O
held	O
in	O
blocks	O
or	O
'	O
storage	O
cells	O
 '	O
on	O
the	O
storage	O
servers	O
.	O
</s>
<s>
These	O
storage	O
cells	O
are	O
opaque	B-General_Concept
to	I-General_Concept
the	I-General_Concept
storage	I-General_Concept
server	I-General_Concept
and	O
are	O
returned	O
to	O
the	O
database	O
engine	O
on	O
request	O
,	O
by	O
their	O
identifier	O
.	O
</s>
<s>
Storage	B-Operating_System
Indexes	I-Operating_System
provides	O
data	O
pruning	O
at	O
this	O
layer	O
:	O
efficiently	O
indicating	O
sections	O
that	O
are	O
of	O
no	O
further	O
interest	O
.	O
</s>
<s>
The	O
Storage	B-Operating_System
Index	I-Operating_System
is	O
loaded	O
into	O
memory	O
on	O
the	O
storage	O
server	O
,	O
so	O
that	O
when	O
a	O
request	O
for	O
cells	O
is	O
issued	O
it	O
may	O
be	O
predicated	O
with	O
search	O
values	O
.	O
</s>
<s>
These	O
are	O
compared	O
to	O
the	O
Storage	B-Operating_System
Index	I-Operating_System
and	O
then	O
only	O
the	O
relevant	O
cells	O
need	O
be	O
returned	O
to	O
the	O
database	O
node	O
.	O
</s>
<s>
Performance	O
advantages	O
with	O
a	O
Storage	B-Operating_System
Index	I-Operating_System
are	O
most	O
evident	O
when	O
the	O
indexed	O
column	O
contains	O
many	O
nulls	B-Language
.	O
</s>
<s>
Massive	O
performance	O
advantages	O
are	O
gained	O
when	O
scanning	O
across	O
sparse	B-Algorithm
data	I-Algorithm
.	O
</s>
<s>
Development	O
for	O
PostgreSQL	B-Application
was	O
carried	O
out	O
as	O
part	O
of	O
the	O
AXLE	O
project	O
(	O
Advanced	O
Analytics	O
for	O
Extremely	O
Large	O
European	O
Databases	O
)	O
This	O
work	O
was	O
partially	O
funded	O
by	O
the	O
European	O
Union	O
's	O
Seventh	O
Framework	O
Programme	O
(	O
FP7/2007	O
-2013	O
)	O
.	O
</s>
<s>
Implementation	O
for	O
PostgreSQL	B-Application
was	O
first	O
evident	O
in	O
2013	O
.	O
</s>
<s>
BRIN	O
appeared	O
in	O
release	O
9.5	O
of	O
PostgreSQL	B-Application
at	O
the	O
start	O
of	O
2016	O
.	O
</s>
