Are my tables indexed? no
Using Smart Queries? I assume not...don't know what those are
My PHP files that are taking a long time to pull info from the 10K record db look something like this:
<?php
$db = new ps_DB;
if ($start_id && $end_id) {
$q = <<<EOQ
SELECT * FROM orders, order_item, product, payment_method, order_payment, user_info, auth_user_md5
WHERE orders.order_id=order_item.order_id
AND order_payment.order_id=orders.order_id
AND product.product_id=order_item.product_id
AND user_info.user_id=auth_user_md5.user_id
AND orders.user_id=user_info.user_id
AND order_item.user_info_id=user_info.user_info_id
AND payment_method.payment_method_id=order_payment.payment_method_id
AND orders.order_id BETWEEN '{$start_id}' AND '{$end_id}'
ORDER BY orders.order_id
EOQ;
$db->query($q);
if (!$db->num_rows() ) {
echo "No orders found.<BR>";
}
// PRINT THE HEADER
// ====================================
// echo "order_id\tsku\tquantity\tfirst_name\tlast_name<br>\n";
//CHECK CONDITIONS - WHILE LOOP
while ($db->next_record() ) {
// PRINT THE RECORDS
/ ====================================
echo $db->f("order_id")."\t".$db->f("product_sku")."\t".$db->f("product_quantity")."\t".$db->f("first_name")."\t".$db->f("last_name")."<br>\n";
/
etc etc...you get the gist here...