Skip to content

Instantly share code, notes, and snippets.

View armanddp's full-sized avatar

Armand du Plessis armanddp

View GitHub Profile
@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.
@speedmax
speedmax / mongo_active_model_compat.rb
Created March 25, 2010 12:53
MongoMapper ActiveModel serialization compatible
module ActiveModel::Compatible
extend ActiveSupport::Concern
extend ActiveModel::Naming
include ActiveModel::Serializers::Xml
include ActiveModel::Serializers::JSON
def to_xml(options = {}, &block)
options[:except] ||= []
options[:except] << :_id