Top "Query-optimization" questions

For questions about making database queries run faster.

View mysql query cache contents

I have a large database application that uses mysqls query cache ability. I'd like to inspect the contents of the …

mysql query-optimization query-cache
Where might I find a method to convert an arbitrary boolean expression into conjunctive or disjunctive normal form?

I've written a little app that parses expressions into abstract syntax trees. Right now, I use a bunch of heuristics …

algorithm query-optimization boolean-expression
PostgreSQL query runs faster with index scan, but engine chooses hash join

The query: SELECT "replays_game".* FROM "replays_game" INNER JOIN "replays_playeringame" ON "replays_game"."id" = "replays_playeringame"."game_id" …

postgresql indexing query-optimization postgresql-performance
Multiple Column Index vs Multiple Indexes

I have the following table in a MySQL database: CREATE TABLE `secondary_images` ( `imgId` int(10) unsigned NOT NULL AUTO_INCREMENT, `…

mysql database database-design indexing query-optimization
Increment counter or insert row in one statement, in SQLite

In SQLite, given this database schema CREATE TABLE observations ( src TEXT, dest TEXT, verb TEXT, occurrences INTEGER ); CREATE UNIQUE INDEX …

sql sqlite query-optimization
Optimizing select with transaction under SQLite 3

I read that wrapping a lot of SELECT into BEGIN TRANSACTION/COMMIT was an interesting optimization. But are these commands …

sqlite transactions query-optimization
How to properly index a many-many association table?

In a typical many-many arrangement like this... Movies Actors Movies_Actors ------ ------ ------------- movie_ID actor_ID FK_movie_…

sql sql-server postgresql many-to-many query-optimization
How to interpret the output of MySQL EXPLAIN?

I want to select the content of the column text from entrytable. EXPLAIN SELECT text FROM entrytable WHERE user = 'username' &…

mysql query-optimization explain
Optimizing MySql query to avoid using "Using filesort"

I need your help to optimize the query to avoid using "Using filesort".The job of the query is to …

mysql performance optimization query-optimization filesort
Oracle SQL select distinct query to return specific number of rows

I have a table in an Oracle database with a timestamp column nextTime and a string column destName. There are …

sql oracle query-optimization distinct rownum