lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

FullTextTrigger optimization (proposal) #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!

What do you think about these changes in FullTextLucene.FullTextTrigger?

public void fire(Connection conn, Object[] oldRow, Object[] newRow) throws
SQLException {
   if (oldRow != null && newRow == null) {
      // DELETE
      delete(oldRow);
   } else if (oldRow == null && newRow != null) {
      // INSERT
      insert(newRow);
   } else if (oldRow != null && newRow != null) {
      // UPDATE
      for (int i = 0; i < indexColumns.length; i++) {
         int index = indexColumns[i];
         if (!newRow[index].equals(oldRow[index])) {
            delete(oldRow);
            insert(newRow);
            break;
         }
      }
   }
}

Original issue reported on code.google.com by victor.p...@gmail.com on 25 May 2009 at 11:17

GoogleCodeExporter commented 9 years ago
Hi,

Thanks! I will implement this change in the next release.

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 29 May 2009 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 29 May 2009 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 29 May 2009 at 4:08

GoogleCodeExporter commented 9 years ago
Implemented in version 1.1.114

Original comment by thomas.t...@gmail.com on 4 Jun 2009 at 7:22