"Go To Referenced Data" performing bad query

Answered

I'm trying to use "Go To Data" in DataGrip to navigate to a row in another table referenced by a foreign key. However, when I use that feature, it seems "Go To Data" tries to load 9.2 million rows, instead just querying for that specific row. 

 

Those 4 queries are all executed immediately after I use Go To Data. The query ends up taking forever and I have to cancel it. Instead, it should just be doing:

SELECT * FROM user WHERE id = "123"

That query completes almost instantly.

Is this a bug? As it stands this feature is unusable for large tables.

7 comments
Comment actions Permalink

I'm having exactly the same problem. To me this feature as it is now is completely useless (and frankly, it would be a feature that would make me choose DataGrip over other solutions). I just cannot understand why it does not filter only by primary key.

0
Comment actions Permalink

I've created an issue https://youtrack.jetbrains.com/issue/DBE-7105 you can track and vote for. Pay attention to the related issues too.

0
Comment actions Permalink

Hi all
In version 2019.2 when you invoke "Go to related data" action you will see two options:
- Referencing rows only. It will load only specific row(s) (e.g. where id = 4)
- First referencing row. This option has old behaviour and it performs multiple queries

0
Comment actions Permalink

I used to use "Go to Related Data" and "Referencing Rows Only" all the time. Saved me so much time! But now, in version 2019.3.1, it seems to be broken. In the little pop-up table picker, where it used to give me tons of options (every foreign key relationship) it now only gives me a small number of them and I can't figure out why. Is this something that changed in Datagrip? Is it something about my configuration? Any insight would be a huge help. 

0
Comment actions Permalink

Hi Jake,

You are right, it's a bug. I already fixed it, next update should work well

https://youtrack.jetbrains.com/issue/DBE-9873

0
Comment actions Permalink

Ah. Great! Thank you. Do you when when the next update is slated for release?

0

Please sign in to leave a comment.