Skip to main content

eliminating cross join

  • April 12, 2018
  • 2 replies
  • 10 views

jumanji
Forum|alt.badge.img+1

Hi,

I was solving this issue
https://forum.vertica.com/discussion/239524/how-to-fix-corelated-subquery-with-not-in#latest

and found the answer using cross join. However, this query is taking a lot of time as the cross join is resulting in several billions of rows. I want to achieve the same result without cross join.

is there a way to achieve this?

2 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • April 13, 2018

Can you share the query you wrote?


jumanji
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • April 23, 2018

Hi VerticaForums,

It is the same query what you have given, but I have millions of records in players table when we take cross product with thousands of records in matches it will result in billions of records. That is the problem.

How do we rewrite this query, to solve this issue