[GH-ISSUE #7] Approaches for same server or not #140

Closed
opened 2026-03-07 20:41:28 +03:00 by kerem · 1 comment
Owner

Originally created by @webian on GitHub (May 15, 2016).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/7

Hi @jasdeepkhalsa,
I can't get the reason why you use 2 different approaches if the comparison is between same servers or different.
I mean this code in method getDiff of TableData:

if ($server1 == $server2) {
  return $this->localTableData->getDiff($table, $sourceKey);
} else {
  return $this->distTableData->getDiff($table, $sourceKey);
}

Please, can you help me to understand?

Originally created by @webian on GitHub (May 15, 2016). Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/7 Hi @jasdeepkhalsa, I can't get the reason why you use 2 different approaches if the comparison is between same servers or different. I mean this code in method getDiff of TableData: ``` if ($server1 == $server2) { return $this->localTableData->getDiff($table, $sourceKey); } else { return $this->distTableData->getDiff($table, $sourceKey); } ``` Please, can you help me to understand?
kerem closed this issue 2026-03-07 20:41:29 +03:00
Author
Owner

@jasdeepkhalsa commented on GitHub (May 17, 2016):

If I have to guess the reason it's probably that when it's the same server and thus a local database, there are other clever optimizations that we do in order to make the diff super fast across millions of rows. I would doubt these optimizations would work if the database is a remote one.

<!-- gh-comment-id:219666488 --> @jasdeepkhalsa commented on GitHub (May 17, 2016): If I have to guess the reason it's probably that when it's the same server and thus a local database, there are other clever optimizations that we do in order to make the diff super fast across millions of rows. I would doubt these optimizations would work if the database is a remote one.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DBDiff#140
No description provided.