Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDuplicate queries in sql application log on Browse data #1108
Comments
mglatz
changed the title
Duplicate query on Browse data
Duplicate queries in sql application log on Browse data
Aug 28, 2017
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
Thanks @mglatz, that should help us get it figured out. |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
Heh Heh Heh That was ages ago, so yeah... I have nearly no recollection. |
This comment has been minimized.
This comment has been minimized.
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) |
This comment has been minimized.
This comment has been minimized.
yes there is. I also saved the db after each change |
added a commit
that referenced
this issue
Oct 7, 2017
This comment has been minimized.
This comment has been minimized.
@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). |
This comment has been minimized.
This comment has been minimized.
hi, seems the issue is fixed. |
mglatz
closed this
Oct 9, 2017
This comment has been minimized.
This comment has been minimized.
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 |
mglatz commentedAug 28, 2017
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: