Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

My old patches cherry-picked from master branch

Open dlnsk opened this issue 9 years ago • 8 comments

Can't pass function name through setCallbacks because it encoding as option.

dlnsk avatar Nov 02 '15 04:11 dlnsk

Thanks for this PR, @dlnsk...

timgws avatar Nov 02 '15 05:11 timgws

Next commit (1853d41) fix wrong count when groupBy used in query.

dlnsk avatar Nov 03 '15 05:11 dlnsk

hey @dlnsk your first commit it's doing the same thing that i did here: https://github.com/Chumper/Datatable/pull/348 ?

Javier-Rotelli avatar Nov 03 '15 19:11 Javier-Rotelli

@dlnsk did you try setting the noGroupByOnCount option on QueryEngine? This should remove the group by before doing the count, which should lead to having the correct table count.

Doing:

        return \DB::table(\DB::raw('('.$originalBuilder->toSql().') as temp_tbl'))
                    ->mergeBindings($originalBuilder->getQuery())
                    ->count();

is not good, because it means a full table scan will need to be done for each search, sort and count, which will be extremely slow (http://dev.mysql.com/doc/refman/5.7/en/subquery-optimization.html)

timgws avatar Nov 04 '15 00:11 timgws

@timgws it isn't the same. When I use groupBy I want know how many groups there are. Not how many items in all groups which noGroupByOnCount gives. I can use setSearchWithAlias() but in my opinion it should be slower than subquery because need to send hundreds or even thousands records through network layer for php's count(). And it gives wrong result for language.infoFiltered ("filtered from MAX total entries") message.

dlnsk avatar Nov 04 '15 17:11 dlnsk

@Javier-Rotelli yes ;o) but in little less lines

dlnsk avatar Nov 04 '15 18:11 dlnsk

true :p in this commit e035066 is a test for that functionality. maybe it helps

Javier-Rotelli avatar Nov 04 '15 18:11 Javier-Rotelli

@Javier-Rotelli thanks but it already in main develop branch

dlnsk avatar Nov 06 '15 05:11 dlnsk