gpt4 book ai didi

mySQL select statement only returning data from a certain key range(MySQL SELECT语句仅返回特定键范围内的数据)

转载 作者:bug小助手 更新时间:2023-10-26 21:03:33 28 4
gpt4 key购买 nike



I'm running a select statement on a table to return all rows where the value in column "NewickSpeciesName" is 'Acanthisitta_chloris':

我在一个表上运行一个select语句,以返回列“NewickSpeciesName”中的值为'Newickisitta_chloris'的所有行:


SELECT * from PfamAlignments
WHERE
NewickSpeciesName ='Acanthisitta_chloris'
INTO OUTFILE '/home/raymondhon/public/pfamstest.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

This returns a csv with some but not all of the rows. Looking at the .cvs, it looks like mysql pulled rows fulfilling my criteria, but only up to a certain value on my key column. That is, in the table, there are rows where "NewickSpeciesName" is "Acanthisitta_chloris" and the key column value is in the multiples of millions.
(https://i.stack.imgur.com/hGCen.png)

这将返回包含部分(但不是全部)行的CSV。查看.cv,看起来MySQL拉出了满足我的条件的行,但仅限于我的键列上的某个值。也就是说,在表中,有一些行的“NewickSpeciesName”是“Acanthisitta_Chloris”,键列的值是百万的倍数。(https://i.stack.imgur.com/hGCen.png))


Whereas, in the .csv, the the largest value in the key column is 322079.
(https://i.stack.imgur.com/3xJPP.png)

而在.csv中,键列中的最大值为322079。(https://i.stack.imgur.com/3xJPP.png))


What might be the cause for this? If it makes any difference, my table has over 11 million rows, and I'm running the mysql script on DBeaver, and I'm SSH tunneling from my local computer to the database I'm accessing.

造成这种情况的原因可能是什么?如果有什么不同的话,那就是我的表有1100多万行,我在DBeaver上运行MySQL脚本,并且从我的本地计算机通过SSH隧道连接到我正在访问的数据库。


更多回答

There are limits to filesystem file sizes, Excel has limits to row counts, and dbeaver has limits to RAM etc. It sounds like you've exceeded one of them.

文件系统文件大小有限制,Excel有行数限制,dbeaver有RAM限制等等。听起来您已经超过了其中之一。

I think it's a feature of Dbeaver that's causing this. I'm currently trying SQL Editor> select all rows. I'll update and close if this works.

我想是海狸的一个特征导致了这个。我正在尝试SQL编辑器>选择所有行。我会更新和关闭,如果这工作。

优秀答案推荐

DBeaver converts your SQL statement and appends a LIMIT clause.
To avoid this, set ResultSet Fetch size in DBeaver settings to -1 (=infinite).

DBeaver转换您的SQL语句并附加一个LIMIT子句。要避免这种情况,请在DBeaver设置中将ResultSet Fetch Size设置为-1(=Infinite)。


更多回答

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com