NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
try this one (Score:1)
FROM bill b INNER JOIN invoices i USING(invoice)
WHERE i.affid = 654248 AND b.desctype = 0 AND i.commpaid = 0;
Now, i think you probably want to have invoice indexed on both sides of the equation, BUT since mysql can only use one index per table I suggest you have an index on i (invoice, affid) and b (invoice)
I don't know how your tables look with data in them or your other queries, but you should probably have less indexes and more indexes that involve more than one column.
Reply to This