Skip to content

Commit

Permalink
Faster query
Browse files Browse the repository at this point in the history
  • Loading branch information
bochoven committed Jul 31, 2016
1 parent d8ef7c8 commit d11586e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/listing/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@

<tbody>
<?php $profile_item_obj = new Profile_model();
$items = $profile_item_obj->select('profile_name, (select COUNT(DISTINCT serial_number) from profile p2 where profile.profile_name = p2.profile_name) AS num_profiles, payload_name, serial_number, GROUP_CONCAT(payload_data) as payload_data', '1 GROUP BY profile_name, payload_name, serial_number');

$sql = 'profile_name, COUNT(DISTINCT serial_number) AS num_profiles, payload_name, GROUP_CONCAT(DISTINCT payload_data) as payload_data';
$where = '1 GROUP BY profile_name, payload_name';
$items = $profile_item_obj->select($sql, $where);
$profile = array();
$profilecount = array();
$payloaddata = array();
Expand Down

0 comments on commit d11586e

Please sign in to comment.