Welcome Guest, Not a member yet? Register   Sign In
Slow DB queries with MS-SQL
#3

(02-01-2017, 03:09 AM)burgoyn1 Wrote: Indexes. Somewhere in your query whatever you are trying to search on is not indexed so to find the data it has to read all 17,000 rows. If you set an index on the value you are looking up, it should read much faster.

Side note, even 2 seconds is really slow so there might be another issue too, hard to know for sure without looking at the server.

Hi,

I have done a fresh install using wamp and some testing.  What I have found is when using a <table> it is a lot slower to draw as apposed to just echo the data out field after field.  Below is the snippet I quickly did in the view, there is quite a time difference when you take the <table> parts out.

Using WAMP, Codeigniter, Bootstrap and MS-SQL.

Code:
<div class="row buffer-top">
    <div class="col-md-12">
        <table>
                <?php
                    foreach($rows as $row) {
                        echo '<tr>';
                            echo '<td>'.$row->id.'</td>';
                            echo '<td>'.$row->rlProductDescription.'</td>';
                            echo '<td>'.$row->rlARTG.'</td>';
                            echo '<td>'.$row->rlMBatchNo.'</td>';
                            echo '<td>'.$row->rlQuantity.'</td>';
                            echo '<td>'.($row->rlManufacturer=='999999' ? '' : $row->rlManufacturer).'</td>';
                            echo '<td>'.($row->rlPacker=='999999' ? '' : $row->rlPacker).'</td>';
                            echo '<td>'.$row->rlReleaseDate.'</td>';
                            echo '<td>'.($row->rlFirstRelease ? 'Yes' : 'No').'</td>';
                            echo '<td>'.$row->rlPONumber.'</td>';
                        echo '</tr>';
                    }
                ?>
            </table>
    </div>
</div>
Reply


Messages In This Thread
Slow DB queries with MS-SQL - by shedger - 01-31-2017, 10:29 PM
RE: Slow DB queries with MS-SQL - by burgoyn1 - 02-01-2017, 03:09 AM
RE: Slow DB queries with MS-SQL - by shedger - 02-02-2017, 02:45 PM
RE: Slow DB queries with MS-SQL - by spjonez - 02-08-2017, 07:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB