[bug #68149] sqlite very slow on large fetch due to buffer resize bug

rot26 <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

URL:
  <https://savannah.gnu.org/bugs/?68149>

                 Summary: sqlite very slow on large fetch due to buffer resize
bug
                   Group: GNU Octave
               Submitter: rot26
               Submitted: Thu 12 Mar 2026 04:59:55 AM UTC
                Category: Octave Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: other
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 12 Mar 2026 04:59:55 AM UTC By: rot26 <rot26>
Octave Sqlite becomes progressively slower to fetch per row, as the number of
rows in the result set increases  -to the point where it quickly becomes
unworkable. 

The problem appears to be that the size of the vector collecting records is
increased by a small constant factor (20 rows) only. 

Doubling the size of this buffer, every time it proves too small seems extreme
but works well (eg on a million rows) and is afaik common practice, when the
ultimate requirement is unknown  -and this may well have been the author's
original intent.

The proposed patch attached, also adds 20 to avoid a resize to 0 on the first
pass, so behaviour for very small fetches will be unchanged.








    _______________________________________________________
File Attachments:

Name: octave_sqlite.cc.diff          Size: 140B
    <https://file.savannah.gnu.org/file/octave_sqlite.cc.diff?file_id=58348>



    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-5479f0ac3e1f014845fd281c379bc3ccb7a72723.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68149>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCabJITwAKCRCqLAuaBUf3
Ts6WAP9fAEZVdhCHJpLWgBkv6SVsRwMAIXICGTquxXI2NJi9GwEAotXOgndny+2o
k7JgOzy17mv0MXBVkl12/N3pcKyK2Qc=
=j0zm
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.