关于这个问题,你可能有兴趣了解手册的这一部分:39.2.2. The DbSelect and DbTableSelecter Adaptation, which states(引引引引引引引引引引引引引引引引引引引引引引,强调):
... the database adapters require a
more detailed explanation.
Contrary to
popular believe, these adapters do not
fetch all records from the database in
order to count them.
Instead, the
adapters manipulates the original
query to produce the corresponding
COUNT
query.
Paginator then executes
that COUNT
query to get the number of
rows.
This does require an extra
round-trip to the database, but this
is many times faster than fetching an
entire result set and using count()
.
Especially with large collections of
data.
www.un.org/Depts/DGACM/index_arabic.htm
The idea is that you will not fetch all data yourself anymore, but you ll tell to Zend_Paginator
which Adapter it must use to access your data.
该校将专门设计成“Data,通过Qry <>/em>进行,并知道如何直接在数据库中加以gin,这意味着只需要什么,而不是像你最初那样的所有数据。