Jump to content

Sql dba unnara va evarina..


Sarvapindi

Recommended Posts

28 minutes ago, dasari4kntr said:

cursors...ekkuva vunnaya..?

No cursors...all temp tables..select into temp tables with lot of joins between tables. 
 

 

Link to comment
Share on other sites

44 minutes ago, ZoomNaidu said:

High level lo post cheyi - can try.

Its basiclaly select into temp table from joining multiple tables..

select * into #temp1

from tableA 

join table b

join table c

join table d

where....

select * from table x  
into #temp2

from table y 

join #temp1

join temp 

etcc..so on..

final select statement is the result 

it has about  8 temp tables..

 

 

Link to comment
Share on other sites

17 minutes ago, Sarvapindi said:

No cursors...all temp tables..select into temp tables with lot of joins between tables. 
 

 

CTE (WITH) try chesava...?  WITH recursion..?

  • Upvote 2
Link to comment
Share on other sites

29 minutes ago, Sarvapindi said:

Its basiclaly select into temp table from joining multiple tables..

select * into #temp1

from tableA 

join table b

join table c

join table d

where....

select * from table x  
into #temp2

from table y 

join #temp1

join temp 

etcc..so on..

final select statement is the result 

it has about  8 temp tables..

 

 

1. Temp table lo use only columns what u need - do not bring everything. 
2. select into #temp1 use cheyakunda, instead create a ddl for #temp1 and then use Insert into temp1 table. This will be little faster. 
3. make sure you use the correct filters in join conditions. 
Inka indexes, constraints kuda vuntaayi..

  • Like 1
Link to comment
Share on other sites

23 minutes ago, Sarvapindi said:

Ya..first ade chesina..then went with temp tables

sql server or oracle...?

select into badulu...try to create a temp table (local / global depends on your needs)...lantivi try cheyii..

break down your...massive single join to ..two to three..

may be that could help...

Link to comment
Share on other sites

1 hour ago, dasari4kntr said:

sql server or oracle...?

select into badulu...try to create a temp table (local / global depends on your needs)...lantivi try cheyii..

break down your...massive single join to ..two to three..

may be that could help...

Sql server

Link to comment
Share on other sites

2 hours ago, ZoomNaidu said:

1. Temp table lo use only columns what u need - do not bring everything. 
2. select into #temp1 use cheyakunda, instead create a ddl for #temp1 and then use Insert into temp1 table. This will be little faster. 
3. make sure you use the correct filters in join conditions. 
Inka indexes, constraints kuda vuntaayi..

will try thxz

Link to comment
Share on other sites

7 hours ago, Sarvapindi said:

Sql server

then..

try the memory optimized tables...like below...

may be..you need to little research on that option....

 

CREATE TABLE dbo.ShoppingCart (   
    ShoppingCartId INT IDENTITY(1,1) PRIMARY KEY NONCLUSTERED,  
    UserId INT NOT NULL INDEX ix_UserId NONCLUSTERED
        HASH WITH (BUCKET_COUNT=1000000),
    CreatedDate DATETIME2 NOT NULL,   
    TotalPrice MONEY  
    ) WITH (MEMORY_OPTIMIZED=ON)   
GO  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...