hi!

after wondering why i can't find alot of records i eventually found the
problem in the sqlserver_adapters implementation of "add_limit_offset!".

the problem is when using MSSQL with the sqlserver_adapter paging will
only work when at least one column is defined in ":order".

for example i was indexing a table with 2912 records, the generated sql
for the batches were these:

SELECT * FROM (SELECT TOP 1000 * FROM (SELECT TOP 1000 * FROM
table_name) AS tmp1 ) AS tmp2
SELECT * FROM (SELECT TOP 1000 * FROM (SELECT TOP 2000 * FROM
table_name) AS tmp1 ) AS tmp2
SELECT * FROM (SELECT TOP 912 * FROM (SELECT TOP 2912 * FROM table_name)
AS tmp1 ) AS tmp2


as you can imagine it was indexing the same top 1000 records 3 times :(

i think a default ordering by the primary key would help to eliminate
that problem.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to