English 中文(简体)
SlectT DISTINCT如此迅速? [复制]
原标题:How is SELECT DISTINCT so fast? [duplicate]
This question already has answers here:
Closed 12 years ago.

Possible Duplicate:
SQL — How is DISTINCT so fast without an index?

页: 1

我有一个数据库,有一个表格,称为Kum的6亿行。 数据库中有2栏——“弧”栏和“最小”栏。 目前没有任何指数。

弧和底之间有相当数量的共同价值观,但也有相当数量的重复增长。

我试图做的第一件事是冲走所有重复的囚室,然后对结果进行一些额外的处理,不过,我已经碰到了一些棘手的问题。

第一,《选举指南》 * WHERE src=434923 和 dest=5010182。 现在,这种回报是相当迅速的结果,然后需要很长的时间才能运行,因为我假定,它将在600万个牢房的其余部分做一个表格。

然而,如果我从链接中看到SlectT DISTINCT,那么它就立即真正迅速地开始返回。 问题是:如何做到这一点? 当然,每行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行各行 年龄

任何想法,为什么SlectT DISTINCT比标准SGE要快得多?

最佳回答

重复问题值得重复回答:

更准确的是,一个问题并不比另一个问题更快。 更确切地说,在完成询问之前所花时间应当与两个问题相同。 不同之处在于,与德国移民归化局的询问只是有更多的回旋余地,因此似乎反应更快,因为你正在快速地收复。 然而,在两者之首下发生的情况是相同的表。 不同的查询有一个数据结构,储存已经归还的东西,并过滤重复。 因此,它实际上需要更长时间才能完成问询,但(退还的)/时间更大,因为只有更多的人能够这样做。 (请注意:一些观点者添加了问答结果限制,使不同的质询似乎较快(因为你打上了结果限制和停顿)。)

问题回答

暂无回答




相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签