This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y = 1 | |
Benchmark.memory do |x| | |
x.report(:master_large_multi_tenant_tenant_test) do | |
y.times do | |
ActiveRecord::Base.establish_connection(adapter: :postgresql, database: :large_multi_tenant_tenant_test).connection | |
ActiveRecord::Base.clear_active_connections! | |
end | |
end | |
x.report(:patch_large_multi_tenant_tenant_test) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DummyTables | |
def self.create_tables | |
100.times do |table_ref| | |
ActiveRecord::Schema.define do | |
create_table "table#{table_ref}" do |t| | |
t.integer :int_col | |
t.string :string_col | |
t.uuid :uuid_col | |
t.hstore :hstore_col | |
t.json :json_col |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adapted from http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html | |
// dependencies | |
var async = require('async'); | |
var AWS = require('aws-sdk'); | |
// set environment vars | |
var DESTINATION_BUCKET = process.env.DESTINATION_BUCKET | |
// get reference to S3 client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further | |
And added some triggers to clean up these dodgy character combinations (ff, fi, fl). | |
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */ | |
-- Working well for me so far -- | |
CREATE TRIGGER insert_Ff AFTER INSERT ON ZWAMESSAGE | |
BEGIN | |
UPDATE ZWAMESSAGE | |
SET ZTEXT = replace( ZTEXT, 'ff', 'f f') | |
WHERE ZWAMESSAGE.ZTEXT like '%ff%'; |