Author |
Topic |
thisisgerald
Starting Member
4 Posts |
Posted - 2015-01-06 : 01:02:26
|
Hi Admin/Gurus,This is my first post here. :)Would like to get comment/feedback on my case. User execute a program with select query which will have a result of 2-3 million of records.Randomly, another user will experience problem creating datausing another program. They access the same database but differenttables. Do the resources used by the program with select querycan be used by another select/insert/update query?Thank you in advance!Best Regards,thisisgerald |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2015-01-06 : 01:49:34
|
Even though the two programs are using different tables , they are still sharing resources , such as memory, disk , CPU , etc.In this situation, analyse how the queries the running and attempt to make them as efficient as possible. 1)Is the query running large table scans?2)Are indexes set up effectively , with statistics up to date.Read more on a systematic approach to tuning a query - http://www.sqlserver-dba.com/2012/11/sql-server-how-to-troubleshoot-a-slow-running-query.htmlJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
thisisgerald
Starting Member
4 Posts |
Posted - 2015-01-06 : 02:21:34
|
Thanks Jackv!I'm not a DBA and only know basic (developer side) on SQL.Below is the table structure and in my understanding, it is okay. Is it?Column Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullnSource CollationBR char no 2 no no no SQL_Latin1_General_CP1_CI_ASPRO char no 6 no no no SQL_Latin1_General_CP1_CI_ASTYP char no 2 no no no SQL_Latin1_General_CP1_CI_ASARG char no 3 no no no SQL_Latin1_General_CP1_CI_ASDEA char no 8 no no no SQL_Latin1_General_CP1_CI_ASSEQ char no 4 no no no SQL_Latin1_General_CP1_CI_ASGLN char no 15 no no no SQL_Latin1_General_CP1_CI_ASCOS char no 10 no no no SQL_Latin1_General_CP1_CI_ASCC char no 3 no no no SQL_Latin1_General_CP1_CI_ASBEI char no 1 no no no SQL_Latin1_General_CP1_CI_ASCOD char no 4 no no no SQL_Latin1_General_CP1_CI_ASQUA char no 1 no no no SQL_Latin1_General_CP1_CI_ASEFF datetime no 8 no (n/a) (n/a) NULLPOS datetime no 8 no (n/a) (n/a) NULLCMN char no 10 yes no yes SQL_Latin1_General_CP1_CI_ASDRC char no 2 yes no yes SQL_Latin1_General_CP1_CI_ASAMO numeric no 9 19 4 yes (n/a) (n/a) NULLSME char no 7 yes no yes SQL_Latin1_General_CP1_CI_ASSAC char no 15 yes no yes SQL_Latin1_General_CP1_CI_ASDES char no 70 yes no yes SQL_Latin1_General_CP1_CI_ASIdentity Seed Increment NotForReplicationNo identity column defined. NULL NULL NULLRowGuidColNo rowguidcol column defined.Data_located_on_filegroupPRIMARYindex_name index_description index_keysQCUPPK clustered, unique, primary key located on PRIMARY BR, PRO, TYP, ARG, DEA, SEQ, GLN, COS, CC, BEI, COD, QUA, EFF, POScontraint_type constraint_name delete_action update_action status_enabled status_for_replication contraint_keysPRIMARY KEY (clustered) QCUPPK (n/a) (n/a) (n/a) (n/a) BR, PRO, TYP, ARG, DEA, SEQ, GLN, COS, CC, BEI, COD, QUA, EFF, POSThanks!thisisgerald |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2015-01-07 : 01:34:48
|
There's a few different strategies you can apply to deal with queries on tables. Does the select statement used , utilise the indexes you have set up? Use the execution plan to analyseJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
thisisgerald
Starting Member
4 Posts |
Posted - 2015-01-07 : 20:47:49
|
Here is the execution plan and I think it is okay because only thoseindexed fields are selected by a simple select query. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2015-01-08 : 01:25:14
|
@thisisgerald - the execution plan is not appearing.Jack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-01-08 : 07:10:39
|
you say that another user is having a problem in a different program. But you haven't yet said what the problem is the other user is experiencing. |
|
|
thisisgerald
Starting Member
4 Posts |
Posted - 2015-01-09 : 01:24:09
|
@jackvCannot insert picture.@gbrittonThe other user problem is sometimes time-out expired or connected to "blocking" issue. As stated in the scenario above, program 2 is accessed my many users (same functions) and only selected user is encountering the problem.Thanks!thisisgerald |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-01-09 : 06:51:46
|
can you post some code? For example, stored procedures that are used by the programs use accessing the database or any pass through queries that are used. |
|
|
|