简体   繁体   English

Pycharm中SQLite数据库中的最大行数

[英]Maximum number of rows in SQLite Database in Pycharm

I am trying to create a sqlite database for an app in python. 我正在尝试为python中的应用程序创建一个sqlite数据库。

So far my database contains one table and it contains 500 entries already, I think. 我认为到目前为止,我的数据库包含一个表,并且已经包含500个条目。 I say this because that is what the built-in database tool in Pycharm tells me. 我之所以这样说是因为Pycharm中的内置数据库工具告诉我。 I then created another table to contain the rest of the data. 然后,我创建了另一个表来包含其余数据。 I think they did not go into the table because it wasn't showing in the database tool. 我认为他们没有进入该表,因为该表未显示在数据库工具中。 So I created another database to insert the rest of the data. 因此,我创建了另一个数据库来插入其余数据。

When I tried to delete some of the data from the first database it deleted but replaced it with some of the data I previously thought hadn't been entered in the first place due to 500 rows limit. 当我尝试从第一个数据库中删除一些数据时,它删除了,但是用一些我以前认为由于500行限制而没有输入的数据代替了它。 I did this in PyCharm and all along it had thrown to exceptions. 我在PyCharm中做到了这一点,一直以来都是例外。 The diver is used was the xerial driver. 潜水员使用的是xerial驱动程序。

What am I doing wrong and how can I get to put all the data in one table? 我在做什么错?如何将所有数据放在一张表中? The final table is going to have a little over 1000 entries. 决赛桌将有1000多个条目。

SQLite has a theoretical maximum row count of 2 64 rows : SQLite的理论最大行数为2 64

The theoretical maximum number of rows in a table is 2 64 (18446744073709551616 or about 1.8e+19). 表中的理论最大行数为2 64 (18446744073709551616或大约1.8e + 19)。 This limit is unreachable since the maximum database size of 140 terabytes will be reached first. 由于将首先达到140 TB的最大数据库大小,因此无法达到此限制。 A 140 terabytes database can hold no more than approximately 1e+13 rows, and then only if there are no indices and if each row contains very little data. 一个140 TB的数据库最多可以容纳大约1e + 13行,然后只有在没有索引并且每行包含的数据很少的情况下才可以。

PyCharm displays database results in pages of a fixed size; PyCharm以固定大小的页面显示数据库结果; use the paging controls (the left and right arrow buttons in the result page toolbar) to page through the results. 使用分页控件(结果页面工具栏中的向左和向右箭头按钮)可对结果进行分页。

You can adjust the page size in your settings, see IDE settings -> database . 您可以在设置中调整页面大小,请参阅IDE设置->数据库 I strongly suspect that the default is set to 500. 我强烈怀疑默认设置为500。

A more reliable way to count your current rows is to query the database: 计算当前行的一种更可靠的方法是查询数据库:

SELECT COUNT(*) FROM <name_of_table>

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

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