Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Improvements since my presentation at RubyKaigi...

Yasuo Honda
September 10, 2016

Improvements since my presentation at RubyKaigi 2014

Since RubyKaigi 2014 Oracle enhanced adapter have implemented new features supporting better Top N query. Since Rails 5 has been released. It will going to have another new features and new major version.

Yasuo Honda

September 10, 2016
Tweet

More Decks by Yasuo Honda

Other Decks in Programming

Transcript

  1. USER.FIRST IN RAILS 4.2 SELECT * FROM ( SELECT "USERS".*

    FROM "USERS" ORDER BY "USERS"."ID" ASC ) WHERE ROWNUM <= 1
  2. USER.FIRST IN RAILS 4.2 (REPEAT) SELECT * FROM ( SELECT

    "USERS".* FROM "USERS" ORDER BY "USERS"."ID" ASC ) WHERE ROWNUM <= 1
  3. USER.FIRST IN RAILS 5 SELECT "USERS".* FROM "USERS" ORDER BY

    "USERS"."ID" ASC FETCH FIRST 1 ROWS ONLY
  4. if current_adapter?(:OracleAdapter) sequence_name = "accounts_seq" id_value = @connection.next_sequence_value(sequence_name) @connection.send(method, "INSERT

    INTO accounts (id, firm_id,credit_limit) VALUES (accounts_seq.nextval,42,5000)", nil, :id, id_value, sequence_name)
  5. NATIVE_DATABASE_TYPES = { - :primary_key => "NUMBER(38) NOT NULL PRIMARY

    KEY", + :primary_key => "NUMBER(38) GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY",