This post is about the context package of golang and how to get started with it. We’ll also disucss the various use cases of it. After reading this blog user should have comprehensive understanding of context package of golang.
Indexes are a common way to enhance database performance. An index allows the database server to find and retrieve specific rows much faster than it could do without an index. Without an index, the system would scan the entire table row by row to find all the matching records. But indexes also add overhead to the database system as a whole, so they should be used sensibly.
Following command can be used to create the index on one or more columns of a table.
CREATE INDEX index-name ON table-name (column-names);
While the creation of index only by default Postgres allows…
This post is in continuation to the previous post. This post deals with the problem of batch upserts in different child tables of same partition set created using pg_partman.
This uses ON CONFLICT clause. This clause specifies an alternative action for raising a unique violation or exclusion constraint violation error. The _createparent() function in partman schema allows us to specify the alternative action that ON CONFLICT clause will use in the case when insertion returns a violation error.
following function creates partition set as in the previous post, but here an action is passed for ON CONFLICT to handle the…
Table partitioning is splitting of a large table in smaller tables based on values of some attribute in the table. This post is about partitioning tables using pg_partman. It provides the following two types of table partitioning,
git clone https://github.com/keithf4/pg_partman
make NO_BGW=1 install
After running above commands successfully, pg_partman should be installed on your machine. running the command in step 4 will provide plain…
I have been using vim for more than three months. Now I do most of my editing on vim. In this post, I shall be describing setting up vim for golang from scratch. Vim config that I shall be posting here is available here. I play with my vim configuration frequently to increase productivity and improve my experience with vim. Follow below sections to set up your vim.
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Product Engineer at Gojek.