-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate queries in sql application log on Browse data #1108
Comments
Oh wow, 70 queries sounds pretty excessive. With that 70 generated queries, was there any kind of scrolling down the browse data tab? Asking because (in theory) DB4S is supposed to load a small amount of rows when going to the Browse Data tab, and only then load more rows as the window is scrolled down. eg load rows on demand for display It sounds like something is going wrong with that, but figured I'd ask just in case. 😄 Also, are we able to get hold of the database schema? Whatever is causing the problem here is probably something to do with how DB4S is understanding the schema, so it'd be useful for @MKleusberg to be able to reproduce the bug on his local development machine. He's on vacation for a few more days though, so none of this can really get looked at until then. 👼 |
On any db and any table I open I get 4 SQL statements (I would expect two). I only get more than 4 rows (up to 70) when the db is opened as project (sqbpro). I've been able to reproduce it:
viewing table produces
viewing table produces here is my db and project |
Thanks @mglatz, that should help us get it figured out. 😄 |
See also #1007 and #641. This started getting looked into, but after Martin added debug code, I couldn't 'read it' in Windows, as I couldn't run it in 'console' mode. |
Heh Heh Heh That was ages ago, so yeah... I have nearly no recollection. 😉 |
Is there a step 3a, "Close database and open project" ? I've tried, but can't reproduce this. (Win 10x64, using v3.10) (Duplicate queries, yes, but not 70 queries) |
yes there is. I also saved the db after each change |
This avoids querying the database twice when selecting a new table. It's an easy fix which works in most circumstances (all except for views with enabled view editing). It can always be improved if necessary. See issue #1108.
@mglatz I've just pushed a commit which in theory should reduce the query count from 4 to 2. Are you ok to download tomorrow's nightly build and test if it's working for you? 😄 I've also looked at your project file but wasn't able to reproduce the 70 queries. Can you check if that's still happening for you? If so, it would also be interesting to know which queries you get (always the same ones or different ones). |
hi, seems the issue is fixed. |
Excellent. 😄 As a data point, @MKleusberg also recently adjusted (last few days) how data is fetched from the database. Instead of using a single thread, it's now multithreaded, to better co-ordinate and (seems like almost) prefetch data. That's probably contributing to the speed up as well. That's new code though, so @MKleusberg is definitely very interested in any weirdness that shows up which might be an intended side effect to fix. eg keep a look out 😀 |
When I go do browse data tab, display SQL log submitted by application, clear that log and select any table/view, I see that both the queries (count and select) gets executed twice or more times producing 4 or more rows in sql log instead of two rows.
On another database I see that the sql log produces 70(!) queries just for selecting a table (not a view) that has no filter or sorting.
I'm opening this issue because:
I'm using DB4S on:
I'm using DB4S version:
I have also:
The text was updated successfully, but these errors were encountered: