func (b *PopulatedMessageStream) populateBigTransaction(txn *message.Transaction, entries []*wal.Entry) { txn.MessageCount = len(entries) seen := make(map[string]bool) tables := []message.Table{} for _, entry := range entries { if entry.Type == wal.Insert || entry.Type == wal.Update || entry.Type == wal.Delete { //TODO: key off of something less expensive key := fmt.Sprintf("%v.%v.%v", entry.DatabaseID, entry.TablespaceID, entry.RelationID) _, found := seen[key] if !found { seen[key] = true table := &message.Table{} table.DatabaseName = b.SchemaReader.GetDatabaseName(entry.DatabaseID) table.Namespace, table.Relation = b.SchemaReader.GetNamespaceAndTable(entry.DatabaseID, entry.RelationID) tables = append(tables, *table) } } } txn.Tables = tables }