<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Blog</title>
 <link href="http://erthalion.info/atom.xml" rel="self"/>
 <link href="http://erthalion.info/"/>
 <updated>2026-07-22T14:52:58+02:00</updated>
 <id>http://erthalion.info</id>
 <author>
   <name>Dmitry Dolgov</name>
   <email></email>
 </author>

 
 
 <entry>
   <title>Milliseconds, Terabytes, Microjoules: energy aware performance tuning for modern times</title>
   <link href="http://erthalion.info/2026/03/12/energy-performance/"/>
   <updated>2026-03-12T00:00:00+01:00</updated>
   <id>http://erthalion.info/2026/03/12/energy-performance</id>
   
   <content type="html">It&apos;s tempting to think about software performance in vacuum, disconnected from any inputs and outputs, abstracted down to optimizing latency or throughput. This way the problem becomes much simpler to deal with, it&apos;s easier to convince others of its importance -- after all everyone wants to do more with less. It&apos;s also a quite dangerous approach, which has less and less place in the modern world. I believe nowadays we face a paradigm shift in how software performance is done -- it becomes more environmentally aware. People asking not only how fast this particular piece of software can be, but also how much energy would it consume, how expensive would that be, how will it affect thermal pollution, etc. In other words what is the input from and output to the environment? In this blog post I would like to discuss challenges associated with such environmental approach to system performance from the engineering point of view. If you ever had to deal with software optimizations, but never thought about energy use -- I hope this article would be a perfect fit for you! If you already did consider this topic, I hope you&apos;ll still find something interesting. How to measure...</content>
   
 </entry>
 
 
 
 <entry>
   <title>What's new in Linux kernel... for PostgreSQL</title>
   <link href="http://erthalion.info/2026/02/03/new-linux-for-postgresql/"/>
   <updated>2026-02-03T00:00:00+01:00</updated>
   <id>http://erthalion.info/2026/02/03/new-linux-for-postgresql</id>
   
   <content type="html">In these times of interdependency and extreme specialization it does not come as a surprise that open source projects depend on each other in many ways. Projects higher in the stack depend on features, provided by projects lower in the stack -- all while driving their development and sorting out issues specific for this particular project. But it&apos;s hardly breaking news that isolation between such dependent projects might be hard to overcome, delaying adoption of new functionality, keeping outdated decisions in place and generally making the world less enjoyable. In the ideal world it&apos;s not a problem -- folks from different communities are watching closely what others are doing, understand correctly why are they doing that and how to apply this knowledge. In reality things are a bit more messy: we don&apos;t always have bandwidth to follow all interesting and important projects, and sometimes people from different communities are almost speaking different languages. And that&apos;s exactly where I&apos;m aiming with this blog post. I&apos;ll try to look through recent Linux kernel changes and identify those that sound interesting for a database like PostgreSQL. It&apos;s a very superficial overview, and after more close inspection it might happen I was wrong, but...</content>
   
 </entry>
 
 
 
 <entry>
   <title>An example for metrics assisted modeling of database performance</title>
   <link href="http://erthalion.info/2025/07/01/small-database-models/"/>
   <updated>2025-07-01T00:00:00+02:00</updated>
   <id>http://erthalion.info/2025/07/01/small-database-models</id>
   
   <content type="html">PostgreSQL community conferences, as many other industry driven events, usually do not have proceedings or anything similar. All you get is a slide deck and, if you&apos;re lucky, a video recording. But it often feels not enough, as it was with one of my talks last year at PGConfDE, where the topic I was talking about included examples of mathematical modeling to predict how the database will behave. Plenty of things were not said or were not communicated with enough details, because they were simply not fitting the format.
The long story short, I&apos;ve managed to summarize the talk as a whitepaper [1] in much more depth and uploaded it to Zenodo, a European open research repository operated by CERN. Let me know what you think about it.
[1]: https://zenodo.org/records/15786156</content>
   
 </entry>
 
 
 
 <entry>
   <title>Demand the impossible: rigorous database benchmarking</title>
   <link href="http://erthalion.info/2023/12/29/statistics-and-benchmarking/"/>
   <updated>2023-12-29T00:00:00+01:00</updated>
   <id>http://erthalion.info/2023/12/29/statistics-and-benchmarking</id>
   
   <content type="html">Everyone knows benchmarking is hard (and writing about benchmarking is double as hard), but have you ever asked &apos;why&apos;? There could be at least few reasons, and they usually have something to do with the inherent duality: it&apos;s necessary to combine expertise from both the domain specific area and general analytics expertise; one have to take into account both known and unknown factors. In this article we try to use this as a base to answer the following: how to not blow up your PostgreSQL benchmark?</content>
   
 </entry>
 
 
 
 <entry>
   <title>Running fast and slow: experiments with BPF programs performance</title>
   <link href="http://erthalion.info/2022/12/30/bpf-performance/"/>
   <updated>2022-12-30T00:00:00+01:00</updated>
   <id>http://erthalion.info/2022/12/30/bpf-performance</id>
   
   <content type="html">My own personal white spot regarding BPF subsystem in Linux kernel was always programs performance and an overall introspection. Or to formulate it more specifically, I wasn&apos;t sure if there is any difference in how we reason about an abstract program performance versus a BPF program? Could we use the same technics and approaches?
You may wonder why even bother when BPF programs are so small and fast? Generally speaking you would be right, but there are cases when BPF programs are not small any more and placed on the hot execution path, e.g. if we talk about a security system monitoring syscalls. In such situations even small overhead is drastically multiplied and accumulated, and it only makes sense to fully understand the system performance to avoid nasty surprises.
It seems many other people also would like to know more about this topic, thus want to share results of my investigation.</content>
   
 </entry>
 
 
 
 <entry>
   <title>PSquare: practical quantiles</title>
   <link href="http://erthalion.info/2021/10/04/psquare/"/>
   <updated>2021-10-04T14:23:45+02:00</updated>
   <id>http://erthalion.info/2021/10/04/psquare</id>
   
   <content type="html">What is a quantile? You face them all the time, sometimes even without knowing that. Computer vision, signal processing, risk management in finance, you name it. The most straightforward example for software engineers would be a monitoring tool that shows the measured value as well as its percentiles, which are special kind of quantiles. Yes, quantiles are everywhere, yet have you asked yourself what happens under the hood when you call `np.percentile`?</content>
   
 </entry>
 
 
 
 <entry>
   <title>How many engineers does it take to make subscripting work?</title>
   <link href="http://erthalion.info/2021/03/03/subscripting/"/>
   <updated>2021-03-03T10:12:45+01:00</updated>
   <id>http://erthalion.info/2021/03/03/subscripting</id>
   
   <content type="html">Recently landed in PostgreSQL, jsonb subscripting support doesn&apos;t look as exciting as some other improvements around jsonb. But it&apos;s user visible changes are only tip of the iceberg. How many people were involved to make it, and what decisions choices were made? How long did it take, and what are the good/bad ideas to work on a patch?</content>
   
 </entry>
 
 
 
 <entry>
   <title>Evolution of tree data structures for indexing: more exciting than it sounds</title>
   <link href="http://erthalion.info/2020/11/28/evolution-of-btree-index-am/"/>
   <updated>2020-11-28T22:12:45+01:00</updated>
   <id>http://erthalion.info/2020/11/28/evolution-of-btree-index-am</id>
   
   <content type="html">What is your first association with the concept of B-tree? Mine is &apos;old and well researched, or in other words boring&apos;. And indeed apparently it was first introduced in 1970! Not only that, already in 1979 they were ubiquitous. Does it mean there is nothing exciting left any more?
It turns out that there are multitude of interesting ideas and techniques around B-Trees. They&apos;re all coming from desire to cover different (often incompatible) needs, as well as adapt to emerging hardware. In this blog post I&apos;ll try to show this, and we will be concerned mostly with B-tree as a data structure.</content>
   
 </entry>
 
 
 
 <entry>
   <title>Query optimizer and chess?</title>
   <link href="http://erthalion.info/2020/08/07/chess-and-optimizer/"/>
   <updated>2020-08-07T12:02:10+02:00</updated>
   <id>http://erthalion.info/2020/08/07/chess-and-optimizer</id>
   
   <content type="html">Do not be afraid, this short blog post is about databases and does not contain any unreasonable metaphysical references. In fact, it&apos;s a result of a journey through couple of whitepapers and books with an unexpected intersection of two rather different fields. I will try to describe everything step by step, so that we can see if chess has anything in common with database query optimizer.</content>
   
 </entry>
 
 
 
 <entry>
   <title>PostgreSQL at low level: stay curious!</title>
   <link href="http://erthalion.info/2019/12/06/postgresql-stay-curious/"/>
   <updated>2019-12-06T14:21:54+01:00</updated>
   <id>http://erthalion.info/2019/12/06/postgresql-stay-curious</id>
   
   <content type="html">It&apos;s not a secret that databases are damn complicated systems. And they tend to run on top of even more complicated stacks of software. Nowadays you will not surprise anyone (or at least not that much) by running your database on a Kubernetes cluster or inside a virtual machine. It&apos;s probably still questionable whether it&apos;s good and appropriate, but this approach is something we have to face — sometimes it&apos;s at least convenient, sometimes it allows to be more resource efficient and sometimes it&apos;s the only available infrastructure in a company. And one of the problems in this situation is that reasoning about the performance is not that easy any more. Well, it&apos;s not like it was much easier before, but still. Let&apos;s see what can we do about it and how strace, perf and BPF can change the game.</content>
   
 </entry>
 
 
 
 <entry>
   <title>Jsonb: few more stories about the performance</title>
   <link href="http://erthalion.info/2017/12/21/advanced-json-benchmarks/"/>
   <updated>2017-12-21T18:34:04+01:00</updated>
   <id>http://erthalion.info/2017/12/21/advanced-json-benchmarks</id>
   
   <content type="html">&lt;blockquote&gt; &lt;p&gt;As such, there’s really no “standard” benchmark that will inform you about the best technology to use for your application. Only your requirements, your data, and your infrastructure can tell you what you need to know.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;For already some time I can’t stop doing interesting/useful/weird (one at the time) benchmarks to reveal some details on how to apply document-oriented approach in the world of relational databases. Finally, I decided that I have a critical mass of those details to share in the form of blog post. So welcome to The Benchmark Club, where we’re going to discuss what it takes to create a fair performance comparison of different databases. As you may guess, the first rule of The Benchmark Club is to never share a reproducible benchmarks. But we identify ourselves as a badass engineers, so we’re going to break this rule today.&lt;/p&gt; &lt;!--break--&gt; &lt;h2 id=&quot;targets&quot;&gt;Targets&lt;/h2&gt; &lt;p&gt;It’s not possible to compare all the existing solutions to store and process the data in form of documents (although looks like people usually expect exactly that), so I’ve limited my scope to PostgreSQL, MySQL and MongoDB:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;PostgreSQL - just because it’s an enlightened database, which is a part of...</content>
   
 </entry>
 
 
 
 <entry>
   <title>How to convert your data to jsonb?</title>
   <link href="http://erthalion.info/2016/06/05/convert-into-jsonb/"/>
   <updated>2016-06-05T02:16:21+02:00</updated>
   <id>http://erthalion.info/2016/06/05/convert-into-jsonb</id>
   
   <content type="html">&lt;p&gt;“How to start” is always a difficult question, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jsonb&lt;/code&gt; isn’t an exception. Here are few notes about converting different types of data into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jsonb&lt;/code&gt;, that someone can find useful.&lt;/p&gt; &lt;p&gt;Basically there are three possible cases of data conversion:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Convert data from inside PostgreSQL&lt;/li&gt; &lt;li&gt;Convert data from other database&lt;/li&gt; &lt;li&gt;Convert plain data outside database&lt;/li&gt; &lt;/ul&gt; &lt;!--break--&gt; &lt;h2 id=&quot;from-inside-postgresql&quot;&gt;From inside PostgreSQL&lt;/h2&gt; &lt;p&gt;First of all we shouldn’t forget we can build data in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jsonb&lt;/code&gt; format manually:&lt;/p&gt; &lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{&quot;id&quot;: 1, &quot;data&quot;: &quot;aaa&quot;}&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;jsonb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; jsonb &lt;span class=&quot;nt&quot;&gt;--------------------------&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id&quot;&lt;/span&gt;: 1, &lt;span class=&quot;s2&quot;&gt;&quot;data&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;aaa&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;jsonb_build_object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;id&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;data&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;aaa&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; jsonb_build_object &lt;span class=&quot;nt&quot;&gt;--------------------------&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id&quot;&lt;/span&gt;: 1, &lt;span class=&quot;s2&quot;&gt;&quot;data&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;aaa&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;If we already have some relational data we can easy perform one-to-one conversion for both complex and simple data types:&lt;/p&gt; &lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to_jsonb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;timestamp&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;2016-06-05&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; to_jsonb &lt;span class=&quot;nt&quot;&gt;-----------------------&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;2016-06-05T00:00:00&quot;&lt;/span&gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class=&quot;language-sql...</content>
   
 </entry>
 
 
 
 <entry>
   <title>The Knife</title>
   <link href="http://erthalion.info/2015/12/29/pandoc/"/>
   <updated>2015-12-29T02:14:21+01:00</updated>
   <id>http://erthalion.info/2015/12/29/pandoc</id>
   
   <content type="html">&lt;p&gt;I really don’t know how I lived before without pandoc. It’s an amazing tool, that saved me from a terrible pain of latex -&amp;gt; MS Word convertion. If you’re writing many scientific documents in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;latex&lt;/code&gt; format, and faced with the demand to convert it into MS Word, you can understand me. It’s like a tiresome point-and-click game, which can consume unbelievable amount of time.&lt;/p&gt; &lt;p&gt;Pandoc can do it, and I’m not kidding. All you need is to create a source file in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;markdown&lt;/code&gt; format and copy all latex formulas. In this post you can find several details.&lt;/p&gt; &lt;!--break--&gt; &lt;p&gt;What do we need to install pandoc? I’ll advise &lt;a href=&quot;https://github.com/commercialhaskell/stack&quot;&gt;stack&lt;/a&gt;:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;stack &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;pandoc pandoc-citeproc pandoc-crossref&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt; &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pandoc-citeproc&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pandoc-crossref&lt;/code&gt; will be used to generate nice bibliography and references.&lt;/p&gt; &lt;p&gt;Now we can do something like this:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-latex&quot; data-lang=&quot;latex&quot;&gt;&lt;span class=&quot;p&quot;&gt;$$&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\frac&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\partial&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\vec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\partial&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\vec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\cdot&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\nabla&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\vec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;\frac&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}{&lt;/span&gt;&lt;span...</content>
   
 </entry>
 
 
 
 <entry>
   <title>Compare incomparable: PostgreSQL vs Mysql vs Mongodb</title>
   <link href="http://erthalion.info/2015/12/29/json-benchmarks/"/>
   <updated>2015-12-29T02:14:21+01:00</updated>
   <id>http://erthalion.info/2015/12/29/json-benchmarks</id>
   
   <content type="html">&lt;blockquote&gt; &lt;p&gt;As such, there’s really no “standard” benchmark that will inform you about the best technology to use for your application. Only your requirements, your data, and your infrastructure can tell you what you need to know.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;NoSql is everywhere and we can’t escape from it (although I can’t say we want to escape). Let’s leave the question about reasons outside this text, and just note one thing - this trend isn’t related only to new or existing NoSql solutions. It has another side, namely the schema-less data support in traditional relational databases. It’s amazing how many possibilities hiding at the edge of the relational model and everything else. But of course there is a balance that you should find for your specific data. It can’t be easy, first of all because it’s required to compare incomparable things, e.g. performance of a NoSql solution and traditional database. Here in this post I’ll make such attempt and show the comparison of jsonb in PostgreSQL, json in Mysql and bson in Mongodb.&lt;/p&gt; &lt;!--break--&gt; &lt;h2 id=&quot;what-the-hell-is-going-on-here&quot;&gt;What the hell is going on here?&lt;/h2&gt; &lt;p&gt;Breaking news:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;http://www.postgresql.org/docs/9.4/static/datatype-json.html&quot;&gt;PostgreSQL 9.4&lt;/a&gt; - a new data type &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jsonb&lt;/code&gt; with slightly extended support in the...</content>
   
 </entry>
 
 
 
 <entry>
   <title>Gentoo and Lenovo u430p - the sad story</title>
   <link href="http://erthalion.info/2015/02/22/gentoo-lenovo/"/>
   <updated>2015-02-22T02:14:21+01:00</updated>
   <id>http://erthalion.info/2015/02/22/gentoo-lenovo</id>
   
   <content type="html">&lt;p&gt;Finally, I decided to replace my old laptop, and my chose fell on the Lenovo u430p. As I understand now, it was not a good idea in case of Gentoo =) Actually, I was surprised, how many nerves you can lose only because of the adaptation of you hardware to your requirements. And here is the shortlist of what you shouldn’t forget, if you want to do the same more easily.&lt;/p&gt; &lt;!--break--&gt; &lt;h2 id=&quot;efi-loader&quot;&gt;EFI loader&lt;/h2&gt; &lt;p&gt;So you’ve successfully passed several steps from Gentoo Handbook. One of the last is Grub2 installation and configuration. You’ve completed this, rebooted and…nothing happened, you see the Windows 8 again.&lt;/p&gt; &lt;p&gt;The clue to this problem is the “Secure Boot” option, which enabled by default in BIOS.&lt;/p&gt; &lt;h2 id=&quot;iwlwifi&quot;&gt;iwlwifi&lt;/h2&gt; &lt;p&gt;Next big disaster is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iwlwifi&lt;/code&gt; driver for the Intel Wireless 7260. The most of wifi routers are working in the mixed 11bgn mode, and 11n drives &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iwlwifi&lt;/code&gt; (and you with him) mad. There are an endless disconnections and the terrible instability.&lt;/p&gt; &lt;p&gt;The only known solution is cut out the 11n mode:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# /etc/modprobe.d/iwlwifi.conf&lt;/span&gt; options iwlwifi &lt;span class=&quot;nv&quot;&gt;11n_disable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt; &lt;p&gt;And you shouldn’t forget to compile &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iwlwifi&lt;/code&gt; as...</content>
   
 </entry>
 
 
 
 <entry>
   <title>Use an exception instead of the NaN</title>
   <link href="http://erthalion.info/2014/08/16/fenv-exceptions/"/>
   <updated>2014-08-16T17:20:42+02:00</updated>
   <id>http://erthalion.info/2014/08/16/fenv-exceptions</id>
   
   <content type="html">&lt;p&gt;This is a small notice about a very useful trick. I often have to deal with computations, because the CFD is the part of my activity. And one of the annoying problem in this kind of research is when after many hours of computations you got a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Not A Number&lt;/code&gt; result, caused by a stupid mistake. It would be nice, if a computation was interrupted by the NaN.&lt;/p&gt; &lt;!--break--&gt; &lt;p&gt;And there is the &lt;a href=&quot;http://stackoverflow.com/a/2949452&quot;&gt;solution&lt;/a&gt;:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;span class=&quot;cp&quot;&gt;#define _GNU_SOURCE #include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;fenv.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt; #include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt; &lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;double&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;feenableexcept&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FE_DIVBYZERO&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FE_INVALID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FE_OVERFLOW&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* should cause an FPE */&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;result is %f&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt; &lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fenv.h&lt;/code&gt; header declares a set of functions and macros to access the floating-point environment, along with specific...</content>
   
 </entry>
 
 
 
 <entry>
   <title>From bash to fish</title>
   <link href="http://erthalion.info/2014/08/09/from-bash-to-fish/"/>
   <updated>2014-08-09T00:20:42+02:00</updated>
   <id>http://erthalion.info/2014/08/09/from-bash-to-fish</id>
   
   <content type="html">&lt;p&gt;I’m doing a small revolution in my environment from time to time. I think “hey, a cool stuff”, take a deep breath and doing something new. And this is story about my migration from the bash to the fish shell.&lt;/p&gt; &lt;p&gt;Let’s see, what says the official tutorial:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;fish is a fully-equipped command line shell (like bash or zsh) that is smart and user-friendly. fish supports powerful features like syntax highlighting, autosuggestions, and tab completions that just work, with nothing to learn or configure. If you want to make your command line more productive, more useful, and more fun, without learning a bunch of arcane syntax and configuration options, then fish might be just what you’re looking for!&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;And this is almost true =) But there is another concrete reason, why I like fish shell:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Search by history (as an autocomplete by tab)&lt;/li&gt; &lt;li&gt;More intuitive and clean configuration files&lt;/li&gt; &lt;li&gt;Vim mode &lt;a href=&quot;https://github.com/fish-shell/fish-shell/issues/65&quot;&gt;support&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!--break--&gt; &lt;p&gt;I would to avoid unnecessary lyrics, and pay more attention to the configuration and gotchas (from the bash point of view).&lt;/p&gt; &lt;p&gt;First of all - use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.&lt;/code&gt; command instead &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source&lt;/code&gt; for the inclusion of the script.&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot;...</content>
   
 </entry>
 
 
 
 <entry>
   <title>Little guide about the gnuchess</title>
   <link href="http://erthalion.info/2014/05/25/gnuchess/"/>
   <updated>2014-05-25T00:20:42+02:00</updated>
   <id>http://erthalion.info/2014/05/25/gnuchess</id>
   
   <content type="html">&lt;p&gt;I’m at the beginning of my journey into the world of gnuchess. Its interface is a slightly tricky, than I’ve expected, but I was interested. So I’ve decided to make some notes about this.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;GNU Chess performs at the senior master/weak international master strength of 2500+ on the Elo rating system&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;I don’t know, what does this mean really, but sounds cool =)&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;It is often used in conjunction with a GUI program such as XBoard or glChess&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;No, it’s not our way. Let’s try to use original teminal-based client (more terminal for the terminal god, mwuahahahaha =).&lt;/p&gt; &lt;!--break--&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gnuchess GNU Chess 6.1.1 Copyright &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;C&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. White &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; : e2e4 TimeLimit[0] &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0 TimeLimit[1] &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0 1. e2e4 black KQkq e3 r n b q k b n r p p p p p p p p &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span...</content>
   
 </entry>
 
 
 
 <entry>
   <title>Another strange thing - an endless paginator</title>
   <link href="http://erthalion.info/2014/04/21/endless-paginator/"/>
   <updated>2014-04-21T20:14:42+02:00</updated>
   <id>http://erthalion.info/2014/04/21/endless-paginator</id>
   
   <content type="html">&lt;p&gt;A little bit about my new program-frankenstein. Now it is an endless &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Paginator&lt;/code&gt; for Django. It sounds crazy, isn’t?&lt;/p&gt; &lt;p&gt;Standart Django &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Paginator&lt;/code&gt; uses the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;count()&lt;/code&gt; function for the verification of page number. It is converted to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SELECT COUNT(*) ...&lt;/code&gt; query, of course. But as I was explained (I really don’t know, maybe it’s just an exaggeration - you can post your opinion in the commentaries), this is not a such lightweight query, as we want for the paginated rest api, because of the &lt;a href=&quot;http://wiki.postgresql.org/wiki/MVCC&quot;&gt;MVCC&lt;/a&gt; in PostgreSQL.&lt;/p&gt; &lt;p&gt;How we can avoid the extra &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;COUNT(*)&lt;/code&gt; query? Don’t panic, we can trick the Django.&lt;/p&gt; &lt;p&gt;First of all we need to disable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;count&lt;/code&gt; parameter from the api response. We can introduce a custom pagination serializer:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# serializers.py &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;CustomPaginationSerializer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BasePaginationSerializer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;NextPageField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;previous&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PreviousPageField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# api.py &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SomeListView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generics&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ListAPIView&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;model&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SomeModel&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serializer_class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SomeSerializerClass&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pagination_serializer_class&lt;/span&gt;...</content>
   
 </entry>
 
 
 
 <entry>
   <title>xi or the fast and furious Haskell</title>
   <link href="http://erthalion.info/2014/03/25/xi/"/>
   <updated>2014-03-25T23:11:42+01:00</updated>
   <id>http://erthalion.info/2014/03/25/xi</id>
   
   <content type="html">&lt;p&gt;Don’t be confused by the title of this post - I will tell you about my experience in the development of xmpp client &lt;a href=&quot;https://github.com/erthalion/xi&quot;&gt;xi&lt;/a&gt;. The first version of this client was written in Haskell in the shortest time (for me, of cource), and this fact provides the second emotional part of title =)&lt;/p&gt; &lt;p&gt;First of all - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xi&lt;/code&gt; was inspired by &lt;a href=&quot;http://tools.suckless.org/ii/]&quot;&gt;ii&lt;/a&gt; irc client. It explains the all of its features, design and main idea. In short - after &lt;a href=&quot;http://erthalion.info/2014/02/16/ii/&quot;&gt;this&lt;/a&gt; post I’m a huge fan of this tool and philosophy.&lt;/p&gt; &lt;p&gt;Second - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xi&lt;/code&gt; was written in Haskell. I will not explain &lt;a href=&quot;http://stackoverflow.com/a/775759/1423473&quot;&gt;why&lt;/a&gt; =)&lt;/p&gt; &lt;p&gt;Now let’s take a look inside. We can see a lot of dependencies of course - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xi&lt;/code&gt; uses &lt;a href=&quot;https://github.com/pontarius/pontarius-xmpp/&quot;&gt;pontarius xmpp&lt;/a&gt; for the XMPP interaction. But there is an interesting hidden trick - we must use this library from the github directly yet, because of an unpleasant &lt;a href=&quot;https://github.com/pontarius/pontarius-xmpp/issues/46&quot;&gt;bug&lt;/a&gt;. This can be done by the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cabal sandbox add-source&lt;/code&gt; command:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;git clone http://github.com/pontarius/pontarius-xmpp .deps/pontarius-xmpp cabal sandbox init cabal sandbox add-source .deps/pontarius-xmpp&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt; &lt;p&gt;Also, if we want to support &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gmail.com&lt;/code&gt;, we must use...</content>
   
 </entry>
 
 
 
 <entry>
   <title>Django and PostgreSQL schemas</title>
   <link href="http://erthalion.info/2014/03/08/django-with-schemas/"/>
   <updated>2014-03-08T13:10:05+01:00</updated>
   <id>http://erthalion.info/2014/03/08/django-with-schemas</id>
   
   <content type="html">&lt;p&gt;There are a some cases, when we prefer to use a PostgreSQL schemas for our purposes. The reasons for this can be different, but how it can be done?&lt;/p&gt; &lt;p&gt;There are a lot of discussion about the implementation of PostgreSQL schemas in Django (for example &lt;a href=&quot;https://code.djangoproject.com/ticket/1051&quot;&gt;one&lt;/a&gt;, &lt;a href=&quot;https://code.djangoproject.com/ticket/6148&quot;&gt;two&lt;/a&gt;). And I want to describe several caveats.&lt;/p&gt; &lt;p&gt;First of all - you shouldn’t use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;options&lt;/code&gt; key to choice a schema like this:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt; &lt;span class=&quot;n&quot;&gt;DATABASES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;OPTIONS&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-c search_path=schema&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt; &lt;p&gt;It can be working, until you &lt;a href=&quot;http://lists.pgfoundry.org/pipermail/pgbouncer-general/2011-August/000842.html&quot;&gt;don’t use pgbouncer&lt;/a&gt;. This option hasn’t supported because of the connection pool - when you close a connection with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;search_path&lt;/code&gt;, it will be returned into the pool, and can be reused with the out of date &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;search_path&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;So what we gonna do? The only choice is to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;connection_create&lt;/code&gt; signal:&lt;/p&gt; &lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# schema.py &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;set_search_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sender&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;kwargs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;django.conf&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;settings&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;conn&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kwargs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span...</content>
   
 </entry>
 
 
 
 <entry>
   <title>A lot of Unix philosophy with the ii</title>
   <link href="http://erthalion.info/2014/02/16/ii/"/>
   <updated>2014-02-16T21:41:00+01:00</updated>
   <id>http://erthalion.info/2014/02/16/ii</id>
   
   <content type="html">&lt;blockquote&gt; &lt;p&gt;Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;It seems like there is no good IRC plugin for vim - I found none of them at least. But there is a brilliant geeky alternative - &lt;a href=&quot;http://tools.suckless.org/ii/&quot;&gt;ii&lt;/a&gt;. Here is a quote from its site:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;ii is a minimalist FIFO and filesystem-based IRC client. It creates an irc directory tree with server, channel and nick name directories. In every directory a FIFO in file and a normal out file is created.&lt;/p&gt; &lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;The in file is used to communicate with the servers and the out files contain the server messages. For every channel and every nick name there are related in and out files created. This allows IRC communication from command line and adheres to the Unix philosophy.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;To configure the IRC workflow (join, identify, read/write) you can use &lt;a href=&quot;http://nion.modprobe.de/blog/archives/440-Using-the-ii-irc-client.html&quot;&gt;these&lt;/a&gt; &lt;a href=&quot;http://userbound.com/blog/ii-a-better-way-to-irc/&quot;&gt;posts&lt;/a&gt;. Here I want to help you avoid several caveats.&lt;/p&gt; &lt;p&gt;First of all, there is the final result you’ll get: &lt;img src=&quot;/public/img/ii.png&quot; border=&quot;0&quot; width=&quot;100%&quot; /&gt;&lt;/p&gt; &lt;p&gt;I’ll use &lt;a href=&quot;http://tmux.sourceforge.net/&quot;&gt;tmux&lt;/a&gt; + &lt;a href=&quot;http://www.vanheusden.com/multitail/&quot;&gt;multitail&lt;/a&gt; + vim.&lt;/p&gt; &lt;p&gt;First...</content>
   
 </entry>
 
 
 
 <entry>
   <title>What about sharding in the Django?</title>
   <link href="http://erthalion.info/2014/02/13/django-sharding/"/>
   <updated>2014-02-13T22:14:42+01:00</updated>
   <id>http://erthalion.info/2014/02/13/django-sharding</id>
   
   <content type="html">&lt;p&gt;Some time ago I was faced with the need to implement the sharding in Django 1.6 . It was an attempt to make step beyond the standart features of this framework and I felt the resistance of Django =) I’ll talk a bit about this challenge and its results.&lt;/p&gt; &lt;p&gt;Let’s start with definitions. Wikipedia says that:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;A database shard is a horizontal partition in a database. Horizontal partitioning is a database design principle whereby rows of a database table are held separately, rather than being split into columns (which is what normalization and vertical partitioning do, to differing extents). Each partition forms part of a shard, which may in turn be located on a separate database server or physical location.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;We wanted split our database entities by the different PostgreSQL schemas and used something like &lt;a href=&quot;http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram&quot;&gt;this&lt;/a&gt; for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;id&lt;/code&gt; generation. The sharding model was clear, but how to implement it in the Django application?&lt;/p&gt; &lt;p&gt;My solution of this problem was a custom database backend, that contains a custom sql compilers. Maybe it was a dirty hack, but I hope it wasn’t =)&lt;/p&gt; &lt;p&gt;To create your own custom database backend, you can copy structure from one...</content>
   
 </entry>
 
 

</feed>
