DatabaseProcApplicationCreatedLinks
sybsystemprocssp_helpconfig_est_maxconcusers  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** sp_helpconfig_est_maxconcusers
4     **
5     **	Estimate the max # of requesters that might be banging away at the
6     **	CPINFO memory pool depending on various config options.
7     **
8     ** Parameters:
9     **	@userconns	- 'user connections' that might run concurrently
10    **	@workerprocs	- 'worker processes' config option
11    **	@maxpardegree	- 'max parallel degree' config option
12    **
13    ** Returns:
14    **	Total # of concurrent requesters that can be active at onetime.
15    {
16    */
17    create or replace procedure sp_helpconfig_est_maxconcusers(
18        @userconns int
19        , @workerprocs int
20        , @maxpardegree int
21    ) as
22        begin
23            declare @retval int -- # of concurrent requesters asking
24                -- for  memory
25                , @numconcwt int -- # of concurrent worker threads
26    
27            -- If parallel degree is not set, then # of worker processes simply
28            -- do not come into effect. Max # of concurrent requesters will
29            -- reduce to # of user connections.
30            --
31            if (@maxpardegree <= 1)
32            begin
33                return @userconns
34            end
35    
36            -- If # of worker procs is high enough in comparison to # of
37            -- user connections such that each user connection can run upto
38            -- configured 'max parallel degree', then total # of requesters
39            -- asking for memory would be deteremined by # worker processes.
40            --
41            if ((@userconns * @maxpardegree * 1.0) <= @workerprocs)
42            begin
43                set @retval = @userconns * (1 + @maxpardegree)
44                return @retval
45            end
46    
47            -- Else, it's  a direct load of user + worker tasks.
48            set @retval = (@userconns + @workerprocs)
49            return @retval
50    
51        end -- }
52    

DEFECTS
 MUCO 3 Useless Code Useless Brackets in create proc 17
 MUCO 3 Useless Code Useless Begin-End Pair 22
 MUCO 3 Useless Code Useless Brackets 31
 MUCO 3 Useless Code Useless Brackets 41
 VUNU 3 Variable is not used @numconcwt 25
 MTR1 2 Metrics: Comments Ratio Comments: 65% 17
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 2 = 3dec - 3exi + 2 17
 MTR3 2 Metrics: Query Complexity Complexity: 11 17

DEPENDENCIES
CALLERS
called by proc sybsystemprocs..sp_helpconfig_process_estimate  
   called by proc sybsystemprocs..sp_helpconfig_est_compinfo_poolsize