Elastic Search key Concepts

The key concepts of Elasticsearch are as follows:

It refers to a single running instance of Elasticsearch. Single physical and virtual server accommodates multiple nodes depending upon the capabilities of their physical resources like RAM, storage and processing power.

It is a collection of one or more nodes. Cluster provides collective indexing and search capabilities across all the nodes for entire data.

3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters.

Example 1:

PostgreSQL operator examples

1. Use NULLS FIRST and NULLS LAST options to explicitly specify the order of NULL with other non-null values.


Protocols and Extensions

Use protocol to declare a protocol.


Using memoization for performance

When doing heavy computations one thing that can be done for increasing performance is not
to repeat any calculation that has already been done and that must be reused. Instead cache the
calculated value in memory, which is called memoization. A great example of this is the Fibonacci


Defer and tracing

The defer keyword allows us to postpone the execution of a statement or a function until the end
of the enclosing (calling) function:
it executes something (a function or an expression) when the enclosing function returns
(after every return and even when an error occurred in the midst of
executing the function, not only a return at the end of the function), but before the } (Why after?
Because the return statement itself can be an expression which does something instead of only
giving back 1 or more variables).


MySQL vs PostgreSQL -- Choose the Right Database for Your Project

The choice of a database management system is usually an afterthought when starting a new project, especially on the Web. Most frameworks come with some object-relational mapping tool (ORM) which more or less hides the differences between the different platforms and makes them all equally slow. Using the default option (MySQL in most cases) is rarely wrong, but it’s worth considering. Don’t fall into the trap of familiarity and comfort – a good developer must always make informed decisions among the different options, their benefits and drawbacks.

Mysql table conversions

There are several ways to convert a table from one storage engine to another, each with
advantages and disadvantages. here are three of the most common ways.

The easiest way to move a table from one engine to another is with an ALTER TABLE
statement. The following command converts mytable to InnoDB:


Useful queries for postgresql

detect which tables might need an index.



Subscribe to Front page feed