pganalyze.com

It's every developer's nightmare: SQL queries that get large and unwieldy. This can happen fairly quickly with the...

Was ist Elastic? Suchmaschine, basierend auf Apache Lucene größtenteils Open-Source einige kommerzielle Features ("Elastic Stack", früher "X-Pack") Zugriffsrechte...

Tod is a gem for working with daytimes. That's a tuple of (hour, minute second) without a day, month...

tableplus.io

To remove all tables from a database (but keep the database itself), you have two options. Option 1: Drop the...

Migrating data from a legacy into a new system can be a surprisingly large undertaking. We have done this a...

wiki.postgresql.org

When you have a large PG database, you may want to find out which tables are consuming the most disk...

makandra dev
begriffs.com

The attached article explains options you have to store the order of items in a database table. The simplest solution...

Don't sum up columns with + in a sql-query if NULL-Values can be present. MySQL and PostgreSQL cannot...

You might have some trouble running a Rails LTS 2 app with MySQL 5.7. If you don't want to...

MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...

stackoverflow.com

mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT...

You should avoid using application models in your migrations. But how else could you create records in a migration?

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02...

I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...

When using GROUP BY, MySQL now complains if the SELECT includes columns which are not part of the GROUP BY...

Like you know from "How to tell ActiveRecord how to preload associations (either JOINs or separate queries)", you can tell...

api.rubyonrails.org

Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your...

#reverse_order does not work with complex sorting constraints and may even silently create malformed SQL for rails < 5.

api.rubyonrails.org

ActiveSupport::Notifications provides an instrumentation API for Ruby. It is used throughout rails to publish instrumentation events that include information...

github.com

We have a new gem Minidusen which extracts Dusen's query parsing and LIKE query functionality. Minidusen can no longer...

guides.rubyonrails.org

ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...

github.com

Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema...

nateberkopec.com

rack-mini-profiler is a powerful Swiss army knife for Rack app performance. Measure SQL queries, memory allocation and CPU...