Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 28 04:58
    uvtofu commented #3045
  • May 28 04:04
    uvtofu commented #3045
  • May 28 04:04
    uvtofu commented #3045
  • May 28 03:57
    uvtofu commented #3045
  • May 28 03:56
    uvtofu commented #3045
  • May 28 03:53
    uvtofu commented #3045
  • May 28 03:15
    uvtofu commented #3045
  • May 28 03:14
    uvtofu commented #3045
  • May 28 03:13
    uvtofu commented #3045
  • May 27 16:11
    uvtofu commented #3045
  • May 27 16:10
    uvtofu commented #3045
  • May 27 15:08
    npiegdon opened #3047
  • May 27 13:10
    lucydodo commented #3045
  • May 27 13:08
    lucydodo labeled #3045
  • May 27 13:08
    lucydodo assigned #3045
  • May 27 08:22
    uvtofu edited #3046
  • May 27 08:21
    uvtofu edited #3046
  • May 27 08:07
    uvtofu edited #3046
  • May 27 08:06
    uvtofu opened #3046
  • May 27 07:24
    uvtofu commented #3045
jessie-github
@jessie-github
But if DB Browser for SQLite is really built in a way to forcibly load the entire database when using the "Browse Data" tab, no problem I'll try to find another way. I just thought that it would be useful to offer the possibility to load in chunks (like the emacs vlf package) but I can understand that it is not a feature which is often requested.
Chris Locke
@chrisjlocke

But if DB Browser for SQLite is really built in a way to forcibly load the entire database

Not intentionally it doesn't - there is a lot of work to make it as smooth as possible (the reason for the 'prefetch block size') but the first thing it has to do is work out how many rows the table has, so it does a 'select count(*) from table', and it's this that can hammer large databases. Even with an index, a 100 GB database is going to take time to get this figure.

jessie-github
@jessie-github
But are you not using max(rowid) to estimate the number of rows ? It seems that it is working (I can see the number of rows at the bottom quite quickly)
jessie-github
@jessie-github
Yes only 5-10 seconds to get the row count for a 100GB database, so I am pretty sure that it is using max(rowid)
Chris Locke
@chrisjlocke
Max(rowid) doesn't tell you the number of rows in a table .. that just shows the highest row number. For tables with auto increment on where rowids aren't recycled, that's not going to be accurate at all - i have a table with one row with a rowid in the thousands...
jessie-github
@jessie-github
I am not sure, but otherwise how is DB Browser for SQLite is calculating the number of rows so quickly (5 seconds for a 100GB file ?). I never deleted any rows so rowid is accurate. Perhaps I should try deleting some rows to see if the number at the bottom is changed. But I thought it was impossible to have an accurate count of the number of rows quickly (i.e. faster than "select count(*)" which is taking ages).
jessie-github
@jessie-github
Ok I tried and deleted some rows and the count displayed by DB Browser for SQLite is quick and accurate ! How do you manage to count the number of rows so quickly ?
Anyway the reason for the freeze is not the process which counts the number of rows then, because the freeze is happening after the count is displayed.
Chris Locke
@chrisjlocke

How do you manage to count the number of rows so quickly ?

I knoweth not. I tend to steer clear of the DB4S code ... here be dragons. I know a lot has gone into making it optimised though... tweaks here and there, etc.
The application log in DB4S might assist in working out where the freeze is occurring.
If you don't need to edit records, the 'execute SQL' tab is useful to grab records, and that should be speedy. The grid is 'read only' which isn't always great.

But I thought it was impossible to have an accurate count of the number of rows quickly (i.e. faster than "select count(*)" which is taking ages

Depends on the version of SQLite. I know SQLite itself (so not DB4S) has sexy internal methods to make this query fast. Depending on the table contents, it can be quicker doing a 'select (1)' rather than a 'select (*)' which would pull in a load of data, only to discard it.

jessie-github
@jessie-github
Ok I looked at the Application Log and indeed to count the number of rows, it is using "SELECT COUNT()" and it is returning the result in 3 seconds (I am surprised !).
The next query is "SELECT 'rowID',
from table LIMIT 0; 253" and the GUI is frozen from there (the first lines does not appear). I tried executing this query outside and it is returning the result instantly.
So there is something wrong around this last query but no means for me to debug this further (nothing in the Error Log as well).
Chris Locke
@chrisjlocke

So there is something wrong around this last query but no means for me to debug this further

That's useful to know - thanks for digging that out.
I would have suggested raising an official issue for it, as it's something we'd like to get fixed, but development has ... er, kinda stalled at the moment and the issue count is >470, so it's going to get lost in the noise for a while, so won't get solved in the short-term.

jessie-github
@jessie-github
No problem, I'll open it and at least we'll have a trace. It is very easy to reproduce. Thanks for your answers
jessie-github
@jessie-github
Justin Clift
@justinclift
Cool. Yeah, DB4S isn't optimised for large databases, even though SQLite itself is a decent enough format for transporting the data between systems.
At present, DB4S loads things into ram and doesn't clear out old loaded data from ram. So, as you scroll through stuff, ram usage just goes higher and higher.
With a (say) 1GB database, you could be using 4GB ram to view it. And ditto, with a 2GB database, you could be using some multiple of 2GB ram to keep it in memory. So, a 100GB database is going to go badly with DB4S if you try and scroll through the whole thing without several hundred GB's of ram.
... and that's not even counting the SQLite backend's processing time for running queries, though indexes can definitely help there. :)
Justin Clift
@justinclift
... and Qt (the library we use for displaying data) seems to have a maximum # of rows it'll handle in it's widgets (16 mill or so from super rough memory). Someone reported a bug about it a few years ago, which Qt team responded as not being interested in changing "you're doing it wrong" kind of response (my wording). ;)
mseaworthy
@mseaworthy
Wondering if there is a way to import multiple CSVs simultaneously in DB Browser? When I attempt to do this, I appears to combine them and they don't end up as separate tables in the db.
Bui Thanh Xuan
@xuan2261
Hello everyone, I have a problem like this: I have a sqlite database with many tables, is there any way to set certain tables to be read-only?
smartmic
@smartmic
Hi there, where can I set the command for "Open in external application"? I want to edit a text cell with the editor of my choice but it opens Firefox instead. I could not find any settings in Preferences and I could also find no documentation about the feature.
Chris Locke
@chrisjlocke

I have a sqlite database with many tables, is there any way to set certain tables to be read-only?

Unfortunately not - a database is a collection of tables, and each table is a collection of rows. That data is either all readable, or if the database is in a read-only file structure, all the data is read-only. If you wanted certain tables to be read-only, you'd have to separate them out into their own database, and make that database read-only. You could then attach the two databases together. This isn't a great solution though, and if someone moved the database to a non-read-only location, could manipulate the database again.
You could encrypt the database, but again, that's an all-or-nothing - you can't just encrypt individual tables. Unless, you wrote the data yourself, of course - if your own application read/wrote to the database, you could write data in an encrypted format so 'joe public' couldn't edit it.

where can I set the command for "Open in external application"?

I believe this saves a .txt file and tries to open that using whatever application normally opens a .txt file. In Firefox, what file is it showing? I assume you're editing text, and not an image or binary data. What operating system are you using?

Manuel
@mgrojo
Yes, DB Browser is saving the cell contents with a file extension appropriate for the detected data. If it's text, ".txt" is added and the default application associated with ".txt" files in the operating system launched.
See sqlitebrowser/sqlitebrowser@a085d99 and linked issues
smartmic
@smartmic
Okay, makes sense. I am working on GNU/Linux. How does it determine what the default application is? I assume it opens based on the xdg-mime type? I do not have xdg-utils installed though. Maybe that is the reason. On my Windows system it works perfectly.
Manuel
@mgrojo
I don't think it uses xdg-open, although the effect should be the same. We use QDesktopServices::openUrl(), maybe is not well supported in all distributions. It works for me under Ubuntu Linux
raboof
@raboof:matrix.org
[m]
when adding data to a column that has a foreign key constraint, is it possible to select the right row from a dropdown instead of having to type it 'manually'?
Manuel
@mgrojo
Yes, that should work in the latest release
1 reply
leon sonnenschein
@leon_sonnenschein:matrix.org
[m]
hey, can someone tell me what is the library that sqlitebrowser use for the front-end?
Chris Locke
@chrisjlocke
For the GUI, or the SQLite library?
If the former, Qt (https://www.qt.io/)
1 reply
leon sonnenschein
@leon_sonnenschein:matrix.org
[m]
I was just in the process of learning that, thanks anyway!