Skip to content

Commit

Permalink
add index to block header and body
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Aug 16, 2018
1 parent 7fd6310 commit d4b0f08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions db/migrate/20180816073015_add_index_to_blocks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddIndexToBlocks < ActiveRecord::Migration[5.2]
def change
add_index :blocks, :header, using: :gin
add_index :blocks, :body, using: :gin
end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2018_08_07_073702) do
ActiveRecord::Schema.define(version: 2018_08_16_073015) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -41,7 +41,9 @@
t.datetime "updated_at", null: false
t.integer "transaction_count"
t.index ["block_number"], name: "index_blocks_on_block_number", unique: true
t.index ["body"], name: "index_blocks_on_body", using: :gin
t.index ["cita_hash"], name: "index_blocks_on_cita_hash", unique: true
t.index ["header"], name: "index_blocks_on_header", using: :gin
end

create_table "meta_data", force: :cascade do |t|
Expand Down

0 comments on commit d4b0f08

Please sign in to comment.