Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Optimized Query With Medium - Huge Data

Author  Topic 

holy008
Starting Member

1 Post

Posted - 2012-05-10 : 13:16:14
Hi, i have a code like this:

SELECT tp.id_invoice, GROUP_CONCAT(mbrg.name) AS goods
FROM
t_payment AS tp
INNER JOIN t_invoices AS tnj ON tp.id_invoice = tnj.id
INNER JOIN d_invoices AS dnj ON dnj.id_invoice=tnj.id
INNER JOIN m_goods AS mbrg ON mbrg.id=dnj.id_goods
INNER JOIN m_customer AS mc ON tnj.id_customer = mc.id
where tp.`status`=1
GROUP BY tp.id_invoices


My query work properly when i use small data, but when my data is growing 1000++, my query work very slow. Executing time is above 5 minutes only for execute this query.

Thx for help me.

NB: Sorry I'm from Indonesia, my English not well.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-10 : 15:58:22
i think you're using MySQL

this is MS SQL Server forum
please post in some MySQL forum to get more help on this

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -