简体   繁体   English

SQLite非常慢:Windows与OpenBSD

[英]SQLite extremely slow: Windows vs. OpenBSD

I read a lot, I know Stackoverflow is full of SQLite speed problems, I tried a lot of thing, but nothing worked. 我读了很多书,我知道Stackoverflow充满了SQLite速度问题,我尝试了很多事情,但是没有任何效果。 And also mine is a little bit different. 我的也有些不同。

So here is my problem: I have an average PC (with i3 cpu) for developing, really nothing special. 所以这是我的问题:我有一台普通的PC(带有i3 cpu)进行开发,真的没什么特别的。 (windows os) (Windows OS)

I have to work with SQLite database files, and on my PC I have really no problems. 我必须使用SQLite数据库文件,并且在我的PC上我确实没有问题。 Queries are fast, I mean which one must runs in 1s it does, which one need 5 secs, it runs in 5 secs. 查询速度很快,我的意思是哪一个必须在1秒钟内运行,哪一个需要5秒钟,它在5秒钟内运行。

But! 但!

The same java code, with the same SQLite queries on our company server (this server has an OpenBSD OS) run EXTREMELY slow. 在我们公司的服务器(此服务器具有OpenBSD OS)上使用相同的Java代码和相同的SQLite查询,运行EXTREMELY的速度很慢。 I mean a 1s query runs in 30 s, and a 5s query runs in 30 min(!!). 我的意思是1秒查询在30秒内运行,而5秒查询在30分钟内(!!)运行。

Unacceptable. 不能接受

I really tried everything: using transactions, not using transactions, add indexes, drop indexes, using different joins, changing my queries, I tried different JDK-s, only running on the server, and building too on the server, but nothing helped: in every case on that server the queries are slow. 我真的尝试了所有事情:使用事务,不使用事务,添加索引,删除索引,使用不同的联接,更改查询,我尝试了不同的JDK-s,仅在服务器上运行,并且也在服务器上构建,但无济于事:在该服务器上的每种情况下,查询速度都很慢。

I have no more ideas why. 我不知道为什么。 Can someone give me a tip about this? 有人可以给我小费吗?

Of course I have 'suspects', but not facts. 我当然有“怀疑”,但没有事实。 One is the OpenBSD itself. 一种是OpenBSD本身。 And also it seems to very slow opening (or connecting to) these database files, but mostly these are just feelings. 而且似乎(打开或连接到)这些数据库文件的速度非常慢,但大多数情况下只是感觉。

If you're using Xerial's sqlite-jdbc library, the official releases include SQLite shared libraries for Linux (x86, x86_64, arm, armhf), FreeBSD (amd64), OS X (x86, x86_64) and Windows (x86, x86_64). 如果您使用Xerial的sqlite-jdbc库,则正式发行版包括适用于Linux(x86,x86_64,arm,armhf),FreeBSD(amd64),OS X(x86,x86_64)和Windows(x86,x86_64)的SQLite共享库。 On other platforms such as OpenBSD, a pure JVM bytecode NestedVM version of SQLite is used which is substantially slower. 在其他平台(如OpenBSD)上,使用的是纯Java JVM字节码NestedVM版本的SQLite,这要慢得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM