Top "Database-indexes" questions

An index contains keys built from one or more columns in the table, or view, and pointers that map to the storage location of the specified data.

How to implement composite primary keys in rails

I have a User model that looks like this: class User < ApplicationRecord belongs_to :organization belongs_to :department end …

ruby-on-rails ruby database ruby-on-rails-5 database-indexes
On Duplicate Update does not work for unique index

My SQL Table I am trying to insert/update has this definition: CREATE TABLE `place`.`a_table` ( `id` bigint(20) NOT …

mysql database-indexes
How binary search is used in database indexing

I know how binary search works but I wanted to know practical uses for binary search... I searched through the …

database algorithm relational-database binary-search database-indexes
Oracle - Create an index only if not exists

Is there any way to create indexes in oracle only if they don't exists ? Something like CREATE INDEX IF NOT …

oracle database-indexes
Whether SQL query will work if there are no indexes on the relations?

GATE1999_2.25 Which of the following is/are correct? A) An SQL query automatically eliminates duplicates B) An SQL query will …

sql database-indexes
MySQL Optimization: EXPLAIN "Extra" column contains "Using Where"

So I always thought that seeing "Using Where" in the Extra column was a good thing. However, I was planning …

mysql database-optimization database-indexes
Why would MySQL use index intersection instead of combined index?

From time to time I encounter a strange MySQL behavior. Let's assume I have indexes (type, rel, created), (type), (rel). …

mysql query-optimization sql-execution-plan database-indexes
Django: Does unique_together imply db_index=True in the same way that ForeignKey does?

A field on a model, foo = models.ForeignKey(Foo) will automatically add a database index for the column, in order …

python django django-models database-indexes