-
Structs and maps are easy to work with in Elixir, but if they are stored in the database as JSON and accessed via an Ecto Schema, it’s not as clear how to query them. We’re going to explore how to do that, and make it clear and easy.
-
You can use PostgreSQL’s JSON data types to store embedded data on Ecto models. But the way Ecto tells you to store it might not be the best way.
-
Use interval
and date_trunc
to make working with SQL dates easier.
-
How to find the oldest or most recent record associated with a particular foreign key.
-
Write queries that combine data from multiple sources.
-
What do you do when indexes aren’t enough?
-
Take a guided tour through a query plan for a “simple” SQL query.
-
Improve query performance by using the right index type.
-
Database views can improve the performance, composability, and readability of
your rails application and Scenic is here to help.
-
Improve the speed of Postgres full-text search by introducing a tsvector column to cache lexemes and using a trigger to keep the lexemes up-to-date.
Sign up to receive a weekly recap from thoughtbot