title: How can merging on a wider p dataframe (n, p) can take more time?
body: <p>I observe longer computation runtime when merging a dataframe with more columns. But the number of links to make remains unganged. Does someone has an insight on the reason of this behaviour ?</p>
  <p>Here is the code :</p>
  <pre><code>def set_vars(n, p):
      np.random.seed(seed=42)
      df = pd.DataFrame(np.random.randint(27, size=(n,p)), columns=['merge'] + list(range(p-1)))
      df_merge = pd.DataFrame(np.concatenate((np.arange(26).reshape((26,1)), 
                                              np.arange(26).reshape((26,1))), axis=1), columns=['merge', 'val'])
      return df, df_merge
  
  df, df_merge = set_vars(1000000, 5)
  
  %%timeit
  b = df.merge(df_merge, on='merge')
  # 255 ms ± 63.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
  
  df, df_merge = set_vars(1000000, 20)
  
  %%timeit
  b = df.merge(df_merge, on='merge')
  # 494 ms ± 46.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
  
  </code></pre>
  <p>Each row after the definition of <code>set_vars()</code> was run separately, so df and df_merge definition are not impacting.</p>
  <p>Not sure to understand why. As the merge is on only one column, why having a big (p) dataset is impacting the performance ?</p>