sql

Tag: sql

32 posts
Reading your own writes with WAIT FOR LSN in Postgres 19Reading your own writes with WAIT FOR LSN in Postgres 19
Redowan's Reflections icon
Redowan's Reflections
rednafi.com

Reading your own writes with WAIT FOR LSN in Postgres 19

PostgreSQL 19's new WAIT FOR LSN command lets a replica block until it has replayed your write. The read-after-write problem it solves, the workarounds it replaces, and what the timeout, status, and mode options are actually for.

·
Jun 12
·
Migrating Off Of Fathom Analytics
Scott Spence icon
Scott Spence
scottspence.com

Migrating Off Of Fathom Analytics

This is the follow-up to Local Analytics with SQLite and SvelteKit. That post covered the infrastructure - batched writes, heartbeat-based live visitors, the production meltdown and rebuild. This one’s about actually removing the Fathom API...

·
Jan 10
·
Local Analytics with SQLite and SvelteKit
Scott Spence icon
Scott Spence
scottspence.com

Local Analytics with SQLite and SvelteKit

I’ve been using Fathom Analytics for years and it’s great, but I wanted something more integrated. Something that could power live visitor counts and popular posts without external API calls. This is what I learned building self-hosted analytics...

·
Dec 28 '25
·
SQL, Math, and Baseball
oh hey, it's owais icon
oh hey, it's owais

SQL, Math, and Baseball

Dev Log 37: 2025-12-16

·
Dec 16 '25
·
SQLite Corruption with fs.copyFile() in WAL Mode
Scott Spence icon
Scott Spence
scottspence.com

SQLite Corruption with fs.copyFile() in WAL Mode

I was looking up something on my site for reference (as I usually do when trying to recall a detail) when I noticed the popular posts in the footer weren’t displaying. That’s odd. I’d been working with the database locally recently, so my immediate...

·
Oct 5 '25
·
Hunting Down 1.3 Billion Row Database Reads
Scott Spence icon
Scott Spence
scottspence.com

Hunting Down 1.3 Billion Row Database Reads

I spent some time this weekend rolling the auth credentials for this site (again) after Claude Code doxed my variables! Anyways, whilst I was doing this I noticed my Turso dashboard had 1.3 BILLION row reads. My database was getting absolutely...

·
Jul 12 '25
·
Create a custom SQL expression with Entity Framework, or how to make EF interpret your Value Types
T
Tim Deschryver
timdeschryver.dev

Create a custom SQL expression with Entity Framework, or how to make EF interpret your Value Types

A deep-dive at the internals of Entity Framework to come up with a solution to make EF interpret your value types, in this particular case a strongly-typed ID (of the StronglyTypedId NuGet Package).

·
Oct 9 '24
·
Predrag Gruevski - Trustfall, Cargo Semver Checks, and the Future of Query-Based Tools
Devtools FM icon
Devtools FM
devtools.fm

Predrag Gruevski - Trustfall, Cargo Semver Checks, and the Future of Query-Based Tools

Predrag Gruevski explores Trustfall, a revolutionary query tool that turns anything into queryable data, and cargo-semver-checks for Rust semantic versioning.

·
Sep 7 '24
·
Importing Large CSV Files into Turso DB
Scott Spence icon
Scott Spence
scottspence.com

Importing Large CSV Files into Turso DB

So, I’ve got these massive CSV files (some up to 233 thousand rows) that I exported from Fathom Analytics. I want to import them into the Turso DB I use for this site, so, eventually visitors will be able to view the data. I’m lot leaving Fathom, I...

·
Jan 19 '24
·
Use Common Table Expressions
Scott Spence icon
Scott Spence
scottspence.com

Use Common Table Expressions

I have the popular posts on this site which are stored in a Turso table, the table is generated from the Fathom Analytics API on this site and you can see them when you get to the bottom of a post or in the footer of the site. Here’s the sitch...

·
Dec 25 '23
·
Spooky Database Relations
Tedium: The Dull Side of the Internet icon
Tedium: The Dull Side of the Internet
tedium.co/

Spooky Database Relations

A discussion of the least-on-brand thing to ever happen on Halloween: The Halloween problem, a database querying issue with a long legacy.

·
Oct 27 '23
·
You can now return unmapped types from raw SQL select statements with Entity Framework 8
T
Tim Deschryver
timdeschryver.dev

You can now return unmapped types from raw SQL select statements with Entity Framework 8

Entity Framework 8 brings a new feature allowing us to execute and return unmapped types from SQL select statements. In this blog post we'll take a quick look at how we can accomplish this, and why this is an important tool to have in your toolkit.

·
Mar 20 '23
·
Consuming SQL Functions with Entity Framework
T
Tim Deschryver
timdeschryver.dev

Consuming SQL Functions with Entity Framework

Using DbFunctions is a method to use database-specific functions in your Entity Framework queries. They allow you to take advantage of features that are specific to a particular database provider, such as SQL Server and use them in your Entity Framework queries in a provider-agnostic way. As an example, let's use the SOUNDEX SQL function.

·
Jan 8 '23
·
Coerce a string into a uuid in Postgres
P
Philihp Busby
philihp.com

Coerce a string into a uuid in Postgres

·
Oct 3 '22
·
Recipes from Python SQLite docsRecipes from Python SQLite docs
Redowan's Reflections icon
Redowan's Reflections
rednafi.com

Recipes from Python SQLite docs

Practical SQLite recipes for Python: execute statements, batch operations, transactions, row factories, and context managers with sqlite3.

·
Sep 10 '22
·
Pick random values from an array in SQL(ite)Pick random values from an array in SQL(ite)
Redowan's Reflections icon
Redowan's Reflections
rednafi.com

Pick random values from an array in SQL(ite)

Emulate Python's random.choice in SQLite using JSON arrays and the random() function. Populate tables with realistic test data efficiently.

·
Sep 1 '22
·
New in Entity Framework 7: Bulk Operations with ExecuteDelete and ExecuteUpdate
T
Tim Deschryver
timdeschryver.dev

New in Entity Framework 7: Bulk Operations with ExecuteDelete and ExecuteUpdate

Exploring the new `ExecuteDelete` and `ExecuteUpdate` methods that were introduced in Entity Framework.

·
Aug 15 '22
·
User Retention with Lness using PostgreSQL and Superset
P
Philihp Busby
philihp.com

User Retention with Lness using PostgreSQL and Superset

·
Oct 5 '21
·
One WEIRD Trick for Speeding Up ORDER BY That You Probably Shouldn't Use
enumerator.dev icon
enumerator.dev
enumerator.dev

One WEIRD Trick for Speeding Up ORDER BY That You Probably Shouldn't Use

I was digging into a performance issue at work recently and found THE WEIRDEST way of speeding up a query that uses ORDER BY. When testing against our replica database, I was getting results up to 100 times faster than before.

·
Apr 28 '21
·
One WEIRD Trick for Speeding Up ORDER BY That You Probably Shouldn't Use
enumerator.dev icon
enumerator.dev
enumerator.dev

One WEIRD Trick for Speeding Up ORDER BY That You Probably Shouldn't Use

I was digging into a performance issue at work recently and found THE WEIRDEST way of speeding up a query that uses ORDER BY. When testing against our replica database, I was getting results up to 100 times faster than before.

·
Apr 28 '21
·
Faster SQL Bulk Inserts With C#
T
Tim Deschryver
timdeschryver.dev

Faster SQL Bulk Inserts With C#

Using SQL Bulk Copy to have a huge performance gain

·
Jan 5 '21
·
Getting to know SQL Server Extended Events
T
Tim Deschryver
timdeschryver.dev

Getting to know SQL Server Extended Events

How to convert your SQL Profiler template to an XEvent template.

·
Aug 16 '20
·
SQL Server Profiler, underused and undervalued
T
Tim Deschryver
timdeschryver.dev

SQL Server Profiler, underused and undervalued

How to use the SQL Server Profiler as a utility knife to get a better understanding of your system.

·
Aug 10 '20
·
Concatenating MySQL Results with Group_concat and Concat_ws
enumerator.dev icon
enumerator.dev
enumerator.dev

Concatenating MySQL Results with Group_concat and Concat_ws

·
May 26 '18
·
Concatenating MySQL Results with Group_concat and Concat_ws
enumerator.dev icon
enumerator.dev
enumerator.dev

Concatenating MySQL Results with Group_concat and Concat_ws

·
May 26 '18
·
Stop abstracting early
N
Numergent
numergent.com

Stop abstracting early

·
Aug 29 '16
·
Selecionar Um Intervalo de Linhas em MySQL
Henrique Dias icon
Henrique Dias
hacdias.com

Selecionar Um Intervalo de Linhas em MySQL

Utilizar MySQL é muito simples. Neste tutorial ensino a selecionar apenas um intervalo de linhas em MySQL.

·
Jul 16 '14
·
Using a SAS LIBNAME's connection in Pass-through
P
Philihp Busby
philihp.com

Using a SAS LIBNAME's connection in Pass-through

·
Mar 12 '12
·
SQL Optimization: Union vs. Union All
P
Philihp Busby
philihp.com

SQL Optimization: Union vs. Union All

·
May 26 '10
·
Counting distinct variables in SQL with SAS
P
Philihp Busby
philihp.com

Counting distinct variables in SQL with SAS

·
Oct 25 '09
·
Avoid Correlated Subqueries in SAS
P
Philihp Busby
philihp.com

Avoid Correlated Subqueries in SAS

·
Sep 15 '08
·
Using a Materialized Path Model for Trees within OLTP Databases (part 1)
P
Philihp Busby
philihp.com

Using a Materialized Path Model for Trees within OLTP Databases (part 1)

·
May 17 '08
·