Skip to content

Instantly share code, notes, and snippets.

View mvikharev's full-sized avatar

Max Vikharev mvikharev

  • Zelenograd, Moscow, Russia
View GitHub Profile
@mvikharev
mvikharev / A Postgres Receipts
Last active January 3, 2017 16:21
Postgresql
A Postgres Receipts
@michaelgodshall
michaelgodshall / ABOUT
Created February 8, 2012 19:48 — forked from Skirmantas/ABOUT
Username maxlength hack for ``django.contrib.auth``
This code is a suggested answer to question asked on Stackoverflow:
http://stackoverflow.com/questions/4827965/can-i-change-djangos-auth-user-username-field-to-be-100-chars-long-without-break/
@j4mie
j4mie / middleware.py
Created May 5, 2011 10:32
Django middleware to log the total number of queries run and query time for every request
from django.db import connection
from django.utils.log import getLogger
logger = getLogger(__name__)
class QueryCountDebugMiddleware(object):
"""
This middleware will log the number of queries run
and the total time taken for each request (with a
status code of 200). It does not currently support
@hgmnz
hgmnz / query_planner.markdown
Created March 23, 2011 14:14
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.