Tag Info

New answers tagged

0

Just going to let you guys know what I did, thanks for responding. I ended up sticking with my original query but added keys to my table, which are apparently a thing I didn't know about. When I did ALTER TABLE tblstatushistory ADD KEY (id), ADD KEY (itemtype) It dropped the time waaaay down. Thanks for pointing me towards resources that taught me about ...


1

The EXPLAIN statement can be very useful when trying to track down the cause of a slow query. There's some great explanations of how to use the EXPLAIN statement and how to interpret its results here (with more real-word examples at /case{2..4}) and the official documentation here. Hope this helps!


0

Sounds like you want only the orders with a certain status/type... SELECT tblstockingorders.*, tblstatushistory.status AS actualStatus FROM tblstockingorders INNER JOIN tblstatushistory ON tblstatushistory.id=tblstockingorders.stockingorderid WHERE tblstatushistory.itemtype=2 AND tblstatushistory.status=0 editted version ...


1

I'd actually think about adding a status column to the table tblstockingorders and having a trigger on that table that injects the status into the tblstatushistory. Granted you'd have to do a 1-time update to all the rows in tblstockingorders (something similar to your query above) and set their last status, but this would give you best overall performance ...


0

Test the inner query to see how well it performs. If you are missing an index on the foreign key, performance may be very slow. The size of your result set can cause performance issues with inner joins. The inner join may need to be run once for each row in your result set. Not having enough memory can cause an issue as data may need to be re-read from ...


2

Try making a temp table with just the data you need and doing a join to that. For each self join do another temp table. I would start with one at a time and check the performance.


1

If you are using Windows, you need not worry about named pipes at all. Why ? Years ago, MySQL for Windows had distributed three(3) different executables: mysqld.exe mysqld-nt.exe mysqld-max-nt.exe The two executeables mysqld-nt.exe and mysqld-max-nt.exe used the named pipes protocol. This is briefly mentioned in Chapter 23 Section 23.2 Page 353 ...


1

This is something you set up when starting the mysqld daemon (or service on Windows). You should (don't have Windows running) be able to see your startup options using the Task Manager (or failing that, use Process Explorer from here).



Top 50 recent answers are included