Skip to content

Instantly share code, notes, and snippets.

View Souloist's full-sized avatar
🐦
:party_parrot:

Richard Shen Souloist

🐦
:party_parrot:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am souloist on github.
  • I am souloist (https://keybase.io/souloist) on keybase.
  • I have a public key ASB332VIgKQnhCRSm7vTwIzmXzGlxwJfizbmMB50e8e1WQo

To claim this, I am signing this object:

Query Optimization

  • When optimizing query performance; the EXPLAIN and EXPLAIN ANALYZE commands are used to display how the postgres query planner decided to run a given query.

  • The query planner resolves a query by building a tree structure of plan nodes for each step involved in determining the optimal way of fetching data from the database.

  • EXPLAIN will not actually run the given query. It will only display the cost estimates that the planner uses for each node.

  • EXPLAIN ANALYZE will display the cost estimates as well as actual time in milliseconds for each node.

  • The query planner's output should be read inside-out, (bottom to top) to determine the order of the query plan.

  • Sample EXPLAIN ANALYZE output:

 Sort  (cost=49150.97..49150.98 rows=2 width=29) (actual time=196.216..196.219 rows=85 loops=1)
@Souloist
Souloist / The Technical Interview Cheat Sheet.md
Created February 6, 2016 06:51 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.