Skip to content

Instantly share code, notes, and snippets.

Each query in MySQL is running as its own transaction, assuming you didn't change this default configuration, and unless you're starting a transaction manually and running multiple deletes in that one transaction.

Because every query is a transaction, MySQL has to save the data being deleted in case of a rollback. Large deletes means saving a TON of data for that potential case.

Additionally, deletes cause a LOT of writes to the binary log. When the delete completes, the query/results of the delete are committed to the binary log,

@ejlp12
ejlp12 / 1_ecs_note.md
Last active September 21, 2023 20:25
ECS Best Practices Notes
@robinsmidsrod
robinsmidsrod / git-branch-sizes
Last active January 29, 2020 00:18
Output all non-merged refs in a git repo, ordered by number of changed lines in the diff output
#!/bin/bash
#
# Output all non-merged refs in a git repo, ordered by number of changed lines in the diff output
#
git for-each-ref --shell --format="ref=%(refname)" --no-merged | \
while read entry
do
eval "$entry"
size=$(git diff -U0 "master...$ref" | grep -vP '^(diff|index|@@|\-\-\-|\+\+\+)' | wc -l)
@qrush
qrush / application_job.rb
Last active March 31, 2020 01:38
Use Honeycomb to trace ActiveRecord calls inside of ActiveJob
class ApplicationJob < ActiveJob::Base
around_perform do |job, block|
Honeycomb.start_span(name: job.class.name) do |span|
span.add_field 'type', 'worker'
span.add_field 'queue.name', job.queue_name
block.call
end
end
end
@mbbx6spp
mbbx6spp / SHORTS.org
Last active May 12, 2019 08:09
List of short movies

My absolute favorite format of film is the short film. Here are a list of short films I loved watching:

@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@nathanpeck
nathanpeck / gist.js
Last active December 28, 2021 11:49
export class MyEcsConstructStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = new ec2.VpcNetwork(this, 'MyVpc', {
maxAZs: 3 // Default is all AZs in region
});
const cluster = new ecs.Cluster(this, 'MyCluster', {
vpc: vpc
@csexton
csexton / compressed_public_key.rb
Created April 10, 2019 16:45
Attempt to generate a compressed public key from EC private key
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
gem "openssl"
end
# See https://github.com/ruby/openssl/issues/29
def real_public_key(k)
# TODO? .point_conversion_form = :compressed
point = k.public_key
@chrisarcand
chrisarcand / keybindings.json
Created April 4, 2019 15:21
VSCode customization....so far.
// Place your key bindings in this file to override the defaults
[
{
"key": "j",
"command": "list.focusDown",
"when": "listFocus"
},
{
"key": "ctrl+f",
"command": "list.focusPageDown",
ARG FUNCTION_RUNTIME
FROM mikesir87/aws-cli as code
ARG FUNCTION_NAME
ARG AWS_DEFAULT_REGION
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
RUN wget -O function.zip `aws lambda get-function --function-name $FUNCTION_NAME --query 'Code.Location' --output text`