Skip to content
Snippets Groups Projects

Optimize joins

1 open thread

convert patch #48 to MR

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
363 363 // and the base table alias. This way, if the same entity table is
364 364 // joined several times for different entity reference fields, each join
365 365 // gets a unique alias.
366 $key = $index_prefix . ($base_table === 'base_table' ? $table : $base_table);
366 $key = $index_prefix . ($base_table === 'base_table' ? $table : $base_table) . $type;
367 367 if (!isset($this->entityTables[$key])) {
368 $this->entityTables[$key] = $this->addJoin($type, $table, "[%alias].[$id_field] = [$base_table].[$id_field]", $langcode);
368 $tables = $this->sqlQuery->getTables();
369 if (isset($tables[$key])) {
370 $this->entityTables[$key] = $key;
371 }
372 elseif (
373 $type === 'INNER' &&
  • Do we really need $type === 'INNER' here? If the table is the same, then it doesn't matter which type of join is used. Anyway, the same table will be used, no? Removing this condition can be useful for the base fields of the entity, which are stored in the same table if the data table is the same as the base table for an entity.

  • Please register or sign in to reply
Please register or sign in to reply
Loading