r/SQL • • 23h ago

PostgreSQL Postgres 19 makes NOT IN 10,000x faster... or 2,000x slower - Which one you get depends on a NOT NULL in your schema, and on how long the list is.

Thumbnail
exobench.ai
10 Upvotes
My write-up, measured on PG17, PG18 and PG19rc2. Declare both columns NOT NULL and PG19 runs NOT IN as an anti join: 1.1 s on PG18, 0.06 ms on PG19. Leave one nullable, even with zero NULLs in it, and PG19 skips the rewrite and stops hashing the list at 154,199 rows instead of 262,144, so 44 ms on PG18 became 101,734 ms. NOT EXISTS was fast on all three.

r/SQL • • 1h ago

SQLite Learning SQL with Python?

Post image
0 Upvotes

This 👉interactive SQLite demonstration helps student understand relational databases.

The sqlite3 extension of 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 makes database content visible alongside Python's data structures. The demo shows how to:

  • Create tables with primary and foreign keys.
  • Model relationships between students, courses, and teachers.
  • Insert data and observe how the database changes.
  • Combine multiple tables using SQL JOIN operations.
  • Use parameterized queries.

The final query answers a seemingly simple question: Which teachers teach Alice, and for which courses? Answering this question involves joining five tables!

With 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡, students can step through the Python program and inspect the database content at every step, directly in their browser, without installing anything.

See 👉other 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 visualizations.


r/SQL • • 5h ago

Oracle Question for Databricks engineers and data architects:

Thumbnail reddit.com
0 Upvotes

r/SQL • • 20h ago

PostgreSQL PostgreSQL For personal budgeting and finance?

13 Upvotes

Im somewhat new to SQL and i want to apply it to my personal life so its easy to keep my skills and knowledge of it fresh since its what i want to do in the future.

I was thinking about setting up a local PostgreSQL database to use with VSCode on my personal computer to just monitor and record my everyday things like my banking/budgeting, random projects that i fall into a hole working on, etc.

I wanted to get some opinions on if this is a good idea, is it safe security wise, is there a better way to go about this, should i just scrap this idea, etc.

Please let me know and educate me!

Everytime i look it up its mainly about business related things like for creating apps etc. but i dont really plan on using it for anything other than my personal projects and plans.

(I chose postgresql because its just one of the more common ones ive seen in job postings etc. and i saw its pretty much free locally)


r/SQL • • 10h ago

BigQuery BigQuery Query Optimization: Myths vs. What Actually Saves Money

Thumbnail
alvin.ai
8 Upvotes