active_record_doctor 1.0.2 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +40 -4
- data/lib/active_record_doctor/printers/io_printer.rb +11 -0
- data/lib/active_record_doctor/tasks/extraneous_indexes.rb +63 -0
- data/lib/active_record_doctor/tasks/unindexed_foreign_keys.rb +6 -2
- data/lib/active_record_doctor/version.rb +1 -1
- data/lib/tasks/active_record_doctor_tasks.rake +5 -0
- data/test/active_record_doctor/tasks/extraneous_indexes_test.rb +25 -0
- data/test/active_record_doctor/tasks/unindexed_foreign_keys_test.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20160213101213_create_users.rb +5 -0
- data/test/dummy/db/schema.rb +5 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +305 -0
- data/test/dummy/log/test.log +15773 -0
- data/test/support/spy_printer.rb +16 -3
- metadata +70 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be1694f7ee06ee05eb0381bea35f5a1446e067ab
|
4
|
+
data.tar.gz: 7e781c490ba3276e6bae081d911b7ffc9e2795a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d30f1aad3a7469e7d0a693bae9254781875025086d3762487c70c5e740d12c9212bfe651f77a8c3b732a93b8d2a748921a654622e851b044882baa6907d9845
|
7
|
+
data.tar.gz: 6dae1b721f9e19573935fc1ca883c5d3fd4a0c73c63d97db9171300259c96cb287a3edf08913a7a56b9dd4c51120308192827083aaeefa930cff6c08470d480a
|
data/README.rdoc
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
= Active Record Doctor
|
2
2
|
|
3
3
|
Active Record Doctor helps to keep the database in a good shape. Currently, it
|
4
|
-
can
|
4
|
+
can:
|
5
|
+
|
6
|
+
* index unindexed foreign keys
|
7
|
+
* detect extraneous indexes
|
8
|
+
|
9
|
+
More features coming soon!
|
10
|
+
|
11
|
+
Want to suggest a feature? Just shoot me {an email}[mailto:contact@gregnavis.com].
|
5
12
|
|
6
13
|
{<img src="https://travis-ci.org/gregnavis/active_record_doctor.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/gregnavis/active_record_doctor]
|
7
14
|
|
@@ -10,9 +17,7 @@ can index unindexed foreign keys. More features coming soon!
|
|
10
17
|
The preferred installation method is adding +active_record_doctor+ to your
|
11
18
|
+Gemfile+:
|
12
19
|
|
13
|
-
|
14
|
-
gem 'active_record_doctor', group: :development,
|
15
|
-
github: 'gregnavis/active-record-doctor'
|
20
|
+
gem 'active_record_doctor', group: :development
|
16
21
|
|
17
22
|
Then run:
|
18
23
|
|
@@ -43,6 +48,37 @@ three-step process:
|
|
43
48
|
|
44
49
|
rake db:migrate
|
45
50
|
|
51
|
+
=== Removing Extraneous Indexes
|
52
|
+
|
53
|
+
Let me illustrate with an example. Consider a +users+ table with columns
|
54
|
+
+first_name+ and +last_name+. If there are two indexes:
|
55
|
+
|
56
|
+
* A two-column index on +last_name, first_name+.
|
57
|
+
* A single-column index on +last_name+.
|
58
|
+
|
59
|
+
Then the latter index can be dropped as the former can play its role. In
|
60
|
+
general, a multi-column index on +column_1, column_2, ..., column_n+ can replace
|
61
|
+
indexes on:
|
62
|
+
|
63
|
+
* +column_1+
|
64
|
+
* +column_1+, +column_2+
|
65
|
+
* ...
|
66
|
+
* +column_1+, +column_2+, ..., +column_(n - 1)+
|
67
|
+
|
68
|
+
To discover such indexes automatically just follow these steps:
|
69
|
+
|
70
|
+
1. List extraneous indexes by running:
|
71
|
+
|
72
|
+
rake active_record_doctor:extraneous_indexes
|
73
|
+
|
74
|
+
2. Confirm that each of the indexes can be indeed dropped.
|
75
|
+
|
76
|
+
3. Create a migration to drop the indexes.
|
77
|
+
|
78
|
+
The indexes aren't dropped automatically because there's usually just a few of
|
79
|
+
them and it's a good idea to double-check that you won't drop something
|
80
|
+
necessary.
|
81
|
+
|
46
82
|
== Author
|
47
83
|
|
48
84
|
This gem is developed and maintained by {Greg Navis}[http://www.gregnavis.com].
|
@@ -10,6 +10,17 @@ module ActiveRecordDoctor
|
|
10
10
|
"#{table} #{columns.sort.join(' ')}"
|
11
11
|
end.join("\n"))
|
12
12
|
end
|
13
|
+
|
14
|
+
def print_extraneous_indexes(extraneous_indexes)
|
15
|
+
if extraneous_indexes.empty?
|
16
|
+
@io.puts("No indexes are extraneous.")
|
17
|
+
else
|
18
|
+
@io.puts("The following indexes are extraneous and can be removed:")
|
19
|
+
extraneous_indexes.each do |index, super_index|
|
20
|
+
@io.puts(" #{index} (can be handled by #{super_index})")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require "active_record_doctor/printers/io_printer"
|
2
|
+
|
3
|
+
module ActiveRecordDoctor
|
4
|
+
module Tasks
|
5
|
+
class ExtraneousIndexes
|
6
|
+
def self.run
|
7
|
+
new.run
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(printer: ActiveRecordDoctor::Printers::IOPrinter.new)
|
11
|
+
@printer = printer
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
@printer.print_extraneous_indexes(extraneous_indexes)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def extraneous_indexes
|
21
|
+
@extraneous_indexes ||=
|
22
|
+
tables.reject do |table|
|
23
|
+
"schema_migrations" == table
|
24
|
+
end.map do |table|
|
25
|
+
indexes = indexes(table)
|
26
|
+
maximum_indexes = indexes.select do |index|
|
27
|
+
indexes.all? do |another_index|
|
28
|
+
index == another_index || !prefix?(index, another_index)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
indexes.reject do |index|
|
33
|
+
maximum_indexes.include?(index)
|
34
|
+
end.map do |extraneous_index|
|
35
|
+
[
|
36
|
+
extraneous_index.name,
|
37
|
+
maximum_indexes.find do |maximum_index|
|
38
|
+
prefix?(extraneous_index, maximum_index)
|
39
|
+
end.name
|
40
|
+
]
|
41
|
+
end
|
42
|
+
end.flatten(1)
|
43
|
+
end
|
44
|
+
|
45
|
+
def prefix?(lhs, rhs)
|
46
|
+
lhs.columns.count <= rhs.columns.count &&
|
47
|
+
rhs.columns[0...lhs.columns.count] == lhs.columns
|
48
|
+
end
|
49
|
+
|
50
|
+
def indexes(table_name)
|
51
|
+
@connection.indexes(table_name)
|
52
|
+
end
|
53
|
+
|
54
|
+
def tables
|
55
|
+
@tables ||= connection.tables
|
56
|
+
end
|
57
|
+
|
58
|
+
def connection
|
59
|
+
@connection ||= ActiveRecord::Base.connection
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -18,7 +18,7 @@ module ActiveRecordDoctor
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def unindexed_foreign_keys
|
21
|
-
connection.tables.select do |table|
|
21
|
+
hash_from_pairs(connection.tables.select do |table|
|
22
22
|
"schema_migrations" != table
|
23
23
|
end.map do |table|
|
24
24
|
[
|
@@ -29,7 +29,7 @@ module ActiveRecordDoctor
|
|
29
29
|
]
|
30
30
|
end.select do |table, columns|
|
31
31
|
!columns.empty?
|
32
|
-
end
|
32
|
+
end)
|
33
33
|
end
|
34
34
|
|
35
35
|
def foreign_key?(table, column)
|
@@ -45,6 +45,10 @@ module ActiveRecordDoctor
|
|
45
45
|
def connection
|
46
46
|
@connection ||= ActiveRecord::Base.connection
|
47
47
|
end
|
48
|
+
|
49
|
+
def hash_from_pairs(pairs)
|
50
|
+
Hash[*pairs.flatten(1)]
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
50
54
|
end
|
@@ -1,7 +1,12 @@
|
|
1
1
|
require "active_record_doctor/tasks/unindexed_foreign_keys"
|
2
|
+
require "active_record_doctor/tasks/extraneous_indexes"
|
2
3
|
|
3
4
|
namespace :active_record_doctor do
|
4
5
|
task :unindexed_foreign_keys => :environment do
|
5
6
|
ActiveRecordDoctor::Tasks::UnindexedForeignKeys.run
|
6
7
|
end
|
8
|
+
|
9
|
+
task :extraneous_indexes => :environment do
|
10
|
+
ActiveRecordDoctor::Tasks::ExtraneousIndexes.run
|
11
|
+
end
|
7
12
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
require 'active_record_doctor/tasks/extraneous_indexes'
|
4
|
+
|
5
|
+
class ActiveRecordDoctor::Tasks::ExtraneousIndexesTest < ActiveSupport::TestCase
|
6
|
+
def test_extraneous_indexes_are_reported
|
7
|
+
result = run_task
|
8
|
+
|
9
|
+
assert_equal(
|
10
|
+
result.sort,
|
11
|
+
[
|
12
|
+
["index_users_on_last_name_and_first_name", "index_users_on_last_name_and_first_name_and_email"],
|
13
|
+
["index_users_on_last_name", "index_users_on_last_name_and_first_name_and_email"]
|
14
|
+
].sort
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def run_task
|
21
|
+
printer = SpyPrinter.new
|
22
|
+
ActiveRecordDoctor::Tasks::ExtraneousIndexes.new(printer: printer).run
|
23
|
+
printer.extraneous_indexes
|
24
|
+
end
|
25
|
+
end
|
@@ -6,7 +6,7 @@ class ActiveRecordDoctor::Tasks::UnindexedForeignKeysTest < ActiveSupport::TestC
|
|
6
6
|
def test_unindexed_foreign_keys_are_reported
|
7
7
|
result = run_task
|
8
8
|
|
9
|
-
assert_equal(
|
9
|
+
assert_equal({ "users" => ["profile_id"] }, result)
|
10
10
|
end
|
11
11
|
|
12
12
|
private
|
Binary file
|
@@ -2,12 +2,17 @@ class CreateUsers < ActiveRecord::Migration
|
|
2
2
|
def change
|
3
3
|
create_table :users do |t|
|
4
4
|
t.string :email
|
5
|
+
t.string :first_name
|
6
|
+
t.string :last_name
|
5
7
|
t.references :profile, foreign_key: true
|
6
8
|
t.references :employer, foreign_key: true
|
7
9
|
t.string :country_code, null: false
|
8
10
|
|
9
11
|
t.timestamps null: false
|
10
12
|
end
|
13
|
+
add_index :users, [:last_name, :first_name, :email]
|
14
|
+
add_index :users, [:last_name, :first_name]
|
15
|
+
add_index :users, :last_name
|
11
16
|
add_index :users, :email, unique: true
|
12
17
|
add_index :users, [:employer_id, :country_code]
|
13
18
|
end
|
data/test/dummy/db/schema.rb
CHANGED
@@ -28,6 +28,8 @@ ActiveRecord::Schema.define(version: 20160213102131) do
|
|
28
28
|
|
29
29
|
create_table "users", force: :cascade do |t|
|
30
30
|
t.string "email"
|
31
|
+
t.string "first_name"
|
32
|
+
t.string "last_name"
|
31
33
|
t.integer "profile_id"
|
32
34
|
t.integer "employer_id"
|
33
35
|
t.string "country_code", null: false
|
@@ -37,5 +39,8 @@ ActiveRecord::Schema.define(version: 20160213102131) do
|
|
37
39
|
|
38
40
|
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
39
41
|
add_index "users", ["employer_id", "country_code"], name: "index_users_on_employer_id_and_country_code"
|
42
|
+
add_index "users", ["last_name", "first_name", "email"], name: "index_users_on_last_name_and_first_name_and_email"
|
43
|
+
add_index "users", ["last_name", "first_name"], name: "index_users_on_last_name_and_first_name"
|
44
|
+
add_index "users", ["last_name"], name: "index_users_on_last_name"
|
40
45
|
|
41
46
|
end
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -652,3 +652,308 @@ Migrating to IndexForeignKeysInUsers (20160402143434)
|
|
652
652
|
FROM sqlite_temp_master
|
653
653
|
WHERE name='index_users_on_email' AND type='index'
|
654
654
|
|
655
|
+
[1m[36m (30.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
656
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
657
|
+
[1m[36m (35.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
658
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.0ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
659
|
+
Migrating to CreateUsers (20160213101213)
|
660
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
661
|
+
[1m[35m (0.2ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "first_name" varchar, "last_name" varchar, "profile_id" integer, "employer_id" integer, "country_code" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
662
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")[0m
|
663
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
664
|
+
FROM sqlite_master
|
665
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
666
|
+
UNION ALL
|
667
|
+
SELECT sql
|
668
|
+
FROM sqlite_temp_master
|
669
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
670
|
+
|
671
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
672
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
673
|
+
FROM sqlite_master
|
674
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
675
|
+
UNION ALL
|
676
|
+
SELECT sql
|
677
|
+
FROM sqlite_temp_master
|
678
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
679
|
+
|
680
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
681
|
+
FROM sqlite_master
|
682
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
683
|
+
UNION ALL
|
684
|
+
SELECT sql
|
685
|
+
FROM sqlite_temp_master
|
686
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
687
|
+
[0m
|
688
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_users_on_last_name" ON "users" ("last_name")
|
689
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
690
|
+
FROM sqlite_master
|
691
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
692
|
+
UNION ALL
|
693
|
+
SELECT sql
|
694
|
+
FROM sqlite_temp_master
|
695
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
696
|
+
[0m
|
697
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
698
|
+
FROM sqlite_master
|
699
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
700
|
+
UNION ALL
|
701
|
+
SELECT sql
|
702
|
+
FROM sqlite_temp_master
|
703
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
704
|
+
|
705
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
706
|
+
FROM sqlite_master
|
707
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
708
|
+
UNION ALL
|
709
|
+
SELECT sql
|
710
|
+
FROM sqlite_temp_master
|
711
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
712
|
+
[0m
|
713
|
+
[1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
714
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
715
|
+
FROM sqlite_master
|
716
|
+
WHERE name='index_users_on_email' AND type='index'
|
717
|
+
UNION ALL
|
718
|
+
SELECT sql
|
719
|
+
FROM sqlite_temp_master
|
720
|
+
WHERE name='index_users_on_email' AND type='index'
|
721
|
+
[0m
|
722
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
723
|
+
FROM sqlite_master
|
724
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
725
|
+
UNION ALL
|
726
|
+
SELECT sql
|
727
|
+
FROM sqlite_temp_master
|
728
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
729
|
+
|
730
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
731
|
+
FROM sqlite_master
|
732
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
733
|
+
UNION ALL
|
734
|
+
SELECT sql
|
735
|
+
FROM sqlite_temp_master
|
736
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
737
|
+
[0m
|
738
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
739
|
+
FROM sqlite_master
|
740
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
741
|
+
UNION ALL
|
742
|
+
SELECT sql
|
743
|
+
FROM sqlite_temp_master
|
744
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
745
|
+
|
746
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")[0m
|
747
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101213"]]
|
748
|
+
[1m[36m (28.3ms)[0m [1mcommit transaction[0m
|
749
|
+
Migrating to CreateProfiles (20160213101232)
|
750
|
+
[1m[35m (0.1ms)[0m begin transaction
|
751
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
752
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101232"]]
|
753
|
+
[1m[36m (33.6ms)[0m [1mcommit transaction[0m
|
754
|
+
Migrating to CreateEmployers (20160213102131)
|
755
|
+
[1m[35m (0.0ms)[0m begin transaction
|
756
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "employers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
757
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213102131"]]
|
758
|
+
[1m[36m (19.2ms)[0m [1mcommit transaction[0m
|
759
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.0ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
760
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
761
|
+
FROM sqlite_master
|
762
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
763
|
+
UNION ALL
|
764
|
+
SELECT sql
|
765
|
+
FROM sqlite_temp_master
|
766
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
767
|
+
[0m
|
768
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
769
|
+
FROM sqlite_master
|
770
|
+
WHERE name='index_users_on_email' AND type='index'
|
771
|
+
UNION ALL
|
772
|
+
SELECT sql
|
773
|
+
FROM sqlite_temp_master
|
774
|
+
WHERE name='index_users_on_email' AND type='index'
|
775
|
+
|
776
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
777
|
+
FROM sqlite_master
|
778
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
779
|
+
UNION ALL
|
780
|
+
SELECT sql
|
781
|
+
FROM sqlite_temp_master
|
782
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
783
|
+
[0m
|
784
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
785
|
+
FROM sqlite_master
|
786
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
787
|
+
UNION ALL
|
788
|
+
SELECT sql
|
789
|
+
FROM sqlite_temp_master
|
790
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
791
|
+
|
792
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
793
|
+
FROM sqlite_master
|
794
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
795
|
+
UNION ALL
|
796
|
+
SELECT sql
|
797
|
+
FROM sqlite_temp_master
|
798
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
799
|
+
[0m
|
800
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
801
|
+
FROM sqlite_master
|
802
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
803
|
+
UNION ALL
|
804
|
+
SELECT sql
|
805
|
+
FROM sqlite_temp_master
|
806
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
807
|
+
[0m
|
808
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
809
|
+
FROM sqlite_master
|
810
|
+
WHERE name='index_users_on_email' AND type='index'
|
811
|
+
UNION ALL
|
812
|
+
SELECT sql
|
813
|
+
FROM sqlite_temp_master
|
814
|
+
WHERE name='index_users_on_email' AND type='index'
|
815
|
+
|
816
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
817
|
+
FROM sqlite_master
|
818
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
819
|
+
UNION ALL
|
820
|
+
SELECT sql
|
821
|
+
FROM sqlite_temp_master
|
822
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
823
|
+
[0m
|
824
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
825
|
+
FROM sqlite_master
|
826
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
827
|
+
UNION ALL
|
828
|
+
SELECT sql
|
829
|
+
FROM sqlite_temp_master
|
830
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
831
|
+
|
832
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
833
|
+
FROM sqlite_master
|
834
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
835
|
+
UNION ALL
|
836
|
+
SELECT sql
|
837
|
+
FROM sqlite_temp_master
|
838
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
839
|
+
[0m
|
840
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
841
|
+
FROM sqlite_master
|
842
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
843
|
+
UNION ALL
|
844
|
+
SELECT sql
|
845
|
+
FROM sqlite_temp_master
|
846
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
847
|
+
[0m
|
848
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
849
|
+
FROM sqlite_master
|
850
|
+
WHERE name='index_users_on_email' AND type='index'
|
851
|
+
UNION ALL
|
852
|
+
SELECT sql
|
853
|
+
FROM sqlite_temp_master
|
854
|
+
WHERE name='index_users_on_email' AND type='index'
|
855
|
+
|
856
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
857
|
+
FROM sqlite_master
|
858
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
859
|
+
UNION ALL
|
860
|
+
SELECT sql
|
861
|
+
FROM sqlite_temp_master
|
862
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
863
|
+
[0m
|
864
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
865
|
+
FROM sqlite_master
|
866
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
867
|
+
UNION ALL
|
868
|
+
SELECT sql
|
869
|
+
FROM sqlite_temp_master
|
870
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
871
|
+
|
872
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
873
|
+
FROM sqlite_master
|
874
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
875
|
+
UNION ALL
|
876
|
+
SELECT sql
|
877
|
+
FROM sqlite_temp_master
|
878
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
879
|
+
[0m
|
880
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
881
|
+
FROM sqlite_master
|
882
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
883
|
+
UNION ALL
|
884
|
+
SELECT sql
|
885
|
+
FROM sqlite_temp_master
|
886
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
887
|
+
[0m
|
888
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
889
|
+
FROM sqlite_master
|
890
|
+
WHERE name='index_users_on_email' AND type='index'
|
891
|
+
UNION ALL
|
892
|
+
SELECT sql
|
893
|
+
FROM sqlite_temp_master
|
894
|
+
WHERE name='index_users_on_email' AND type='index'
|
895
|
+
|
896
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
897
|
+
FROM sqlite_master
|
898
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
899
|
+
UNION ALL
|
900
|
+
SELECT sql
|
901
|
+
FROM sqlite_temp_master
|
902
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
903
|
+
[0m
|
904
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
905
|
+
FROM sqlite_master
|
906
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
907
|
+
UNION ALL
|
908
|
+
SELECT sql
|
909
|
+
FROM sqlite_temp_master
|
910
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
911
|
+
|
912
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
913
|
+
FROM sqlite_master
|
914
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
915
|
+
UNION ALL
|
916
|
+
SELECT sql
|
917
|
+
FROM sqlite_temp_master
|
918
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
919
|
+
[0m
|
920
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
921
|
+
FROM sqlite_master
|
922
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
923
|
+
UNION ALL
|
924
|
+
SELECT sql
|
925
|
+
FROM sqlite_temp_master
|
926
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
927
|
+
[0m
|
928
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
929
|
+
FROM sqlite_master
|
930
|
+
WHERE name='index_users_on_email' AND type='index'
|
931
|
+
UNION ALL
|
932
|
+
SELECT sql
|
933
|
+
FROM sqlite_temp_master
|
934
|
+
WHERE name='index_users_on_email' AND type='index'
|
935
|
+
|
936
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
937
|
+
FROM sqlite_master
|
938
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
939
|
+
UNION ALL
|
940
|
+
SELECT sql
|
941
|
+
FROM sqlite_temp_master
|
942
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
943
|
+
[0m
|
944
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
945
|
+
FROM sqlite_master
|
946
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
947
|
+
UNION ALL
|
948
|
+
SELECT sql
|
949
|
+
FROM sqlite_temp_master
|
950
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
951
|
+
|
952
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
953
|
+
FROM sqlite_master
|
954
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
955
|
+
UNION ALL
|
956
|
+
SELECT sql
|
957
|
+
FROM sqlite_temp_master
|
958
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
959
|
+
[0m
|