Article View: news.software.nntp
Article #88314Re: A comment on SQLNetnews
From: Helm
Date: Thu, 02 Apr 2020 18:44
Date: Thu, 02 Apr 2020 18:44
51 lines
3553 bytes
3553 bytes
On 4/2/2020 1:59 PM, news@zzo38computer.org.invalid wrote: > Helm <please@nospam.invalid> wrote: >> I like it. However, indexes MUST be recommended. Without Indexes, any >> database with more than a couple hundred rows will start to slow down >> significantly. > > Which indexes do you recommend? Note that every UNIQUE constraint and > PRIMARY KEY constraint is also an index, so there is already an index on > message IDs. (Although, perhaps an index on timestamps might be wanted.) > One on NG name and article number (combined index). That why overviews along with MID requests are fast. Timestamps are not really necessary since you don't need to call up a article by timestamp unless you do newnews (which a news admin dosen't need to support) >> I like how you binded SQLite arguments, protects from any injection >> attacks... > > Yes, this is how it should be done when possible. Not only it protects > from injection attacks, but it is also more efficient. Good glad to see someone who agrees. > >> I think storing the articles in a sqllite database is a bad idea. > > Can you explain how? I think if the table is not WITHOUT ROWID, and the > page size is set appropriately, it is OK. Although if you do not want to > do that in your software, you don't have to. > > See also: https://sqlite.org/fasterthanfs.html > From the website: "The performance difference arises (we believe) because when working from an SQLite database, the open() and close() system calls are invoked only once, whereas open() and close() are invoked once for each blob when using blobs stored in individual files. It appears that the overhead of calling open() and close() is greater than the overhead of using the database. The size reduction arises from the fact that individual files are padded out to the next multiple of the filesystem block size, whereas the blobs are packed more tightly into an SQLite database." If you have a buffer filesytem (like CNFS) it will be even faster. Yes, it may be fast even on SQLITE, but the database will start to bottleneck if you are requesting megabytes and megabytes of information per second (article + headers) when you can simply seperate the articles and place less of a load on the sqlite subsystem. Besides, you can't grep a spool. If you do decide to use Sqlite to store articles, I think you should have different files (1 per hierachy?) so the load is distributed. I like your software alot. Nice to see some new fish in the Usenet software industry.
Technical Details
Message-ID:
<r65br5$13b9$1@esteban.tulanet.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<r60obr$2p5f$1@esteban.tulanet.com> <1585764062.bystand@zzo38computer.org>Show Full Headers
Complete Article Headers
Message-ID: <r65br5$13b9$1@esteban.tulanet.com> Subject: Re: A comment on SQLNetnews Date: Thu, 2 Apr 2020 14:44:50 -0400 From: Helm <please@nospam.invalid> References: <r60obr$2p5f$1@esteban.tulanet.com> <1585764062.bystand@zzo38computer.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.nntp Organization: Tula Networks Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: esteban.tulanet.com; logging-data="36201"; posting-host="JN+gOjKDQ0knCrZDOIZ8mQ.user.esteban.tulanet.com"; mail-complaints-to="netnewsmaster@gmail.com"; User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 Content-Language: en-US X-Notice: Filtered by Postfilter with Rennovations Lines: 50