Top "Query-performance" questions

For questions about making database queries run faster.

How to FULL OUTER JOIN multiple tables in MySQL

I need to FULL OUTER JOIN multiple tables. I know how to FULL OUTER JOIN two tables from here. But …

mysql join outer-join query-performance
What is the fastest way to select a single row in SQL? (SQL Server)

I know of two different ways to select a single row from a table (without a where clause that guarantees …

sql sql-server performance query-performance sqlperformance
Why is this mySQL query extremely slow?

Given is a mySQL table named "orders_products" with the following relevant fields: products_id orders_id Both fields are …

mysql sql query-performance where-in
Loading multiple entities by id efficiently in Hibernate

So, I'm getting a number of instances of a particular entity by id: for(Integer songId:songGroup.getSongIds()) { session = HibernateUtil.…

java hibernate entity query-performance identifier
SQLite: Should LIKE 'searchstr%' use an index?

I have a DB with several fields word_id — INTEGER PRIMARY_KEY word — TEXT ... ..and ~150k rows. Since this is …

sql sqlite cocoa sql-like query-performance
Execute multiple functions together without losing performance

I have this process that has to make a series of queries, using pl/pgsql: --process: SELECT function1(); SELECT function2(); …

postgresql plpgsql database-performance query-performance postgresql-performance
Optimizing COUNT(DISTINCT) slowness even with covering indexes

We have a table in MySql with arround 30 million records, the following is table structure CREATE TABLE `campaign_logs` ( `domain` …

mysql sql aggregate-functions query-performance mysql-variables