Monday, March 12, 2012

Performance probelm with large table

I have a web page to allow user to create Sales Order. For this i have 2 tables, one for the informations (Sales Order) about the order and the other table (Sales Order LineItems ) contains the details of the order. For exemple for one order if i order 2 CD i will have 2 rows for this order in the Sales Order LineItems table.

When i've created the page i've made some test by creating 100 orders. Everything was working fine. Now yesterday i've tried to create 100 000 orders and 400 000 details rows. Since i 've created all thoses order the performance are not good at all. When i tried to open an order on my web page it can take up to 20sec juste to load the page. This make no sense at all since all my queries return only information for one order.
The problem is probably with SQL Server since when i've tried to open my webpage if i tried to launch another query everything is really slow. All my columns have Indexable properties set to yes.

Any idea ? I'm using ADO.NET and most of my Queries are inside StoredProc.

Thanks!

What is your table structure like?

Indexes?

|||

Can u share with us your table structure and if possible query u are trying to execute.

Basic Performance suggestion:

1. Use of index (smart use) No overuse

2. Keep ur statistics up to date.As in ur case u added so many rows it might have invalidated statistics on table.

3. Look for fragmentation in the tables. use dbcc showcontig to find out if any.

4. avoid using select * use column name in select

5. Use show plan to find out index(If u have any on the tables) is being used by SQL Server or not

6. Look for scans (Table scan or index scan) ..any case seek is better

so many others ..

No comments:

Post a Comment