little-brother / sqlite-gui

Lightweight SQLite editor for Windows
GNU General Public License v2.0
1.07k stars 51 forks source link

1.9 slow opening 15Mb table #155

Open valsor opened 2 months ago

valsor commented 2 months ago

Thanks for your great work. I was awaiting for the font rendering fix on scaled display and it's here now. Unfortunately some strange behavior occurs when double-clicking on table name in left panel. If table data is relative big (ca 100 000 records, 15MB) it hangs for ca 10-20 seconds with "(Not response)" label added in window title bar. I'm on en-US Windows10 64 bit. I've tried switching off real-time virus protection with no success. Only rolling back to 1.82 solved the problem. Any ideas?

little-brother commented 2 months ago

Hmm, there are no changes in Edit data-dialog between 1.8.2 and 1.9.0. Try to replace sqlite3.dll by the previous version. Did you table contain BLOB, json, generated columns or smth special? 15mb is huge for a typical data.

Also check in the dialog title how many rows are loaded. Maybe 1.9.0 loads all data. You should go to Settings > Appearence > Max rows in the result output and set it to 10000.

valsor commented 2 months ago

No, the table contains only integer and text data. There are also 2 indices. Nothing special:

CREATE TABLE "product" (
    id              integer PRIMARY KEY,
    kind            integer NOT NULL DEFAULT 1,
    type            integer NOT NULL,
    format          text NOT NULL,
    extent          integer NOT NULL DEFAULT 1,
    name            text NOT NULL,
    active          integer NOT NULL DEFAULT 0,
    avalability     integer NOT NULL DEFAULT 1,
    list_price      integer,
    sale_price      integer,
    discount        real,
    tax_code        text,
    width           integer,
    height          integer,
    length          integer,
    weight          integer,
    packaging       text,
    addons          text,
    create_time     integer NOT NULL DEFAULT (cast(unixepoch('subsec') * 1000 as integer)),
    update_time     integer NOT NULL DEFAULT (cast(unixepoch('subsec') * 1000 as integer)),
    delete_time     integer
);
CREATE INDEX product_create_time_idx ON product(create_time);

I will try to replace sqlite3.dll with v1.82 and let you know about.

valsor commented 2 months ago

I dumped and recreated the database from sql to exclude corruption. Then replaced sqlite3.dll for 1.82 in a clean sqlite-gui installation. Result is the same: 1.82 works fine but 1.90 hangs for 10-20 seconds independent of sqlite3.dll version. It's a pity.

little-brother commented 2 months ago

Also check in the dialog title how many rows are loaded. ...

How many rows are loaded in both cases?

valsor commented 2 months ago

In dialog title it shows 10000. In settings 10000 too. If I change it to 1000 the table is loaded much faster.

valsor commented 2 months ago

1.82 also loads 10000 as in settings.

little-brother commented 2 months ago

I managed to repeat this error on Win10x64. I suppose that the issue is related to a common controls library (Windows standard library). 1.9.0 uses 6.0 instead of 4.8 (it allows to use stylized buttons and another input controls) but it also provides that problem :(

Thanks for the report.

P.S. I use Win7 and there is no change of loading time between 1.8.2 and 1.9.0.

valsor commented 2 months ago

Great! Hope it can be fixed.