Skip to content

Instantly share code, notes, and snippets.

DECLARE @MasterObjects TABLE(Col1 INT, COL2 VARCHAR(24), ...)
INSERT INTO @MasterObjects
SELECT * -- Use only columns you need, not *
FROM MasterTable WHERE ID IN @MyIdList -- @MyIdList is table valued parameter populated with ids you want to pull
SELECT * -- Again only columns you need
FROM SideTable1
JOIN @MasterObjects ON ...
SELECT * -- Ditto
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <limits>
#include <functional>
#include <utility>
#include <stdexcept>
using Number = double;
@zvrba
zvrba / memshared.cpp
Created April 18, 2015 07:31
Compute the amount of memory saved through code sharing of SOs
// See https://www.kernel.org/doc/Documentation/vm/pagemap.txt
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>