Professional Documents
Culture Documents
www.nashire.com
Swinog #21
Martin Blapp, <martin.blapp@nashire.com>
www.nashire.com
A startup company
founded October 2010
We are E-Mail specialists
www.nashire.com
www.nashire.com
www.nashire.com
www.nashire.com
Storage Examples:
- config databases
/app/var/log/maillog/2010-11-08]$ ls
00
03
06
09
12
01
04
07
10
13
02
05
08
11
14
15
16
17
18
19
20
www.nashire.com
- If you are ISP and have mail/access log indexes stored in DBs
- If you need small indexes and like to keep them in memory
- Blacklists with millions of entries (but only if they dont need to be unique)
www.nashire.com
varchar(15)
192.168.100.124
Number:
1 x unsigned int
3232261244
Number:
4 x unsigned smallint
192
CIDR:
168
100
124
www.nashire.com
varchar(39):
fe80::204:23ff:fede:e6f6
Binary:
1 x varbinary(16)
(binary)
Number:
2 x unsigned bigint
18338657682652659712
145280670382352118
Number:
8 x unsigned smallint
65152
516
CIDR:
0
9215
0
65246
0
59126
www.nashire.com
~ 1400 MB
vs.
Number:
381 MB
~ 3000 MB
vs.
Binary:
1525 MB
10
www.nashire.com
Indexes
slow down
writes
11
www.nashire.com
12
www.nashire.com
13
www.nashire.com
14
www.nashire.com
xxx.xxx.xxx.xxx
or
Example:
octa
octb
octc
octd
octa.octb.octc.octd
15
www.nashire.com
XXX.XXX.XXX.XXX or
XXX.XXX.XXX.XXX
You can even add an additional tinyint field with the part index field octb or octc.
16
www.nashire.com
XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
Some remarks:
17
www.nashire.com
XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
18
www.nashire.com
IPv4:
inet_aton
inet_ntoa
( IP-Adress to Number )
( Number to IP-Adress )
IPv6:
inet6_pton
inet6_ntop
19
www.nashire.com
Called for
each
single row
Called
only one
time
20
www.nashire.com
Think about how you or your customers access the data later
Use smart partial indexes for IP-fields to make access really fast
Think about the maximal size your DB will have in the future
21
www.nashire.com
22
www.nashire.com
References:
23
www.nashire.com
Thank you
Any questions?
24