.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

Please help me optimize this Overlap query

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
 
Hi, I have 2 tables: Table1: ls_activated (125,450 records) , screenshot: http://img180.imageshack.us/img180/3282/lsactivated.png Table2: alu (1,194,734 records), screenshot: http://img441.imageshack.us/img441/443/rmskalu.png I want to find how many ALU that are in  a ls_activated record's interval (start-end). basically i want to find the overlapped regions of these two tables (they have to be on the same chromosome) For example: if a ls_activated record has start-end from 3-10, any ALU records that has start-end position that in 1-10 is considered matching. ls_activated:                     3 |---------------------------------------! 10 ALU                              1 |-----------| 5 ALU                                                                          &nbs


View Complete Post


More Related Resource Links

Trying to optimize performance of query having Hash Matches & Agreegate

  

Hi,

I am trying to optimize a stored proc which takes about 20 seconds to execute. I tried building the index and replacing the Table scans with Index seeks and the performance came down to 15 sec which is still bad.

In my execution plan 46% goes for Hash Match Aggregate &

10% for HashMatch (JOINS)

12% sort

32% Index seeks.

Is there a way I can optimize Hash Match Aggregates?

 

My stored proc is union of 3 different views. All the views are Joins of 2 different tables(3*2 =6 tables involved). My base tables already have Indexes defined on the column by which I am joining the tables, I am still not able to get Nested Loop Joins, SQL is executing Hash Match Joins.

Do I need to create Index on views as well to achieve the performance.

 

Thanks in advance

-Jayasree


Trying to optimize performance of query having Hash Matches & Agreegate

  

Hi,

I am trying to optimize a stored proc which takes about 20 seconds to execute. I tried building the index and replacing the Table scans with Index seeks and the performance came down to 15 sec which is still bad.

In my execution plan 46% goes for Hash Match Aggregate &

10% for HashMatch (JOINS)

12% sort

32% Index seeks.

Is there a way I can optimize Hash Match Aggregates?

 

My stored proc is union of 3 different views. All the views are Joins of 2 different tables(3*2 =6 tables involved). My base tables already have Indexes defined on the column by which I am joining the tables, I am still not able to get Nested Loop Joins, SQL is executing Hash Match Joins.

Do I need to create Index on views as well to achieve the performance.

 

Thanks in advance

-Jayasree


Optimize this query

  

Hi can anyone optimize this in query with joins for performing well


SELECT @V_rowCount = COUNT(*)  
FROM ContactDetail C    
WHERE right(C.Value,9) = right(@P_Mobile1,9)      
AND C.CNTYPUID = @V_refMobile1    
AND C.IdentifyingType = 'Address'    
AND C.StatusFlag='A'    
AND C.UID NOT IN (SELECT D.UID     
     FROM ContactDetail D     
     WHERE D.CNTYPUID = @V_refMobile1  
     AND D.IdentifyingType = 'Address'    
     AND (D.IdentifyingUID = @P_AddressUID OR @P_AddressUID IS NULL)    
     AND D.StatusFlag='A'    
      )  


Trying to optimize performance of query having Hash Matches & Agreegate

  

Hi,

I am trying to optimize a stored proc which takes about 20 seconds to execute. I tried building the index and replacing the Table scans with Index seeks and the performance came down to 15 sec which is still bad.

In my execution plan 46% goes for Hash Match Aggregate &

10% for HashMatch (JOINS)

12% sort

32% Index seeks.

Is there a way I can optimize Hash Match Aggregates?

 

My stored proc is union of 3 different views. All the views are Joins of 2 different tables(3*2 =6 tables involved). My base tables already have Indexes defined on the column by which I am joining the tables, I am still not able to get Nested Loop Joins, SQL is executing Hash Match Joins.

Here is my stored proc code. Exec plan is in Excel Spreadsheet form.

https://spreadsheets.google.com/ccc?key=0AtpBDycPp-0_dDZBVHVkdU5QejBmSEE2MGM2bUREQlE&authkey=CN7wqLML&hl=en#gid=0

 

USE [HDIS]
GO
/****** Object: StoredProcedure [dbo].[sp_GetBlockSpecimenInfo] Script Date: 09/23/2010 17:26:11 ******/

By any chance can we able to optimize the below query.. It is running for long time..

  

By any chance, can we optimize the below query..This is running for 2 hrs..As of now, i really don't have any execution plans. 

If i replace "IN" with "Exists", i am saving few minutes. Can someone please optimize the query little more?
SELECT pm.pm_no,
pm.pm_key, 
trunc(pm.last_completion_dt), 
pm.location_name,
loc.unid,
loc.location_desc,
loc.tva_eq_owner_key
FROM 
eam_od_pm_tb pm, 
eam_od_location_tb loc
where 
pm.site_id in ('ALF','BRF', 'COF','CUF','GAF','JOF','JSF','KIF','SHF','WCF', 

Optimize WebResource.axd and ScriptResource.axd in asp.net

  
When the handler is requested by the browser it looks for a URL parameter containing the references to the original resource script. They are separated by a comma in the URL parameter. It then retrieves the content of each script using a HTTP request. Then content is then aggregated into a single string which then get's minified. Minifying means that all comments and whitespace is removed from the script.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

  
If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

How to Encrypt Query String Parameters in ASP.NET

  
Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Content Query Web Part missing in SharePoint 2010

  
If you don't see content query web part listed in the web parts list, this is because you have not enabled "Search Server Web Parts" feature in site collection features. Enable this feature and content query web part will show in the list of web parts.

sql query that don't run

  

Hello....

I'm going crazy... i've got a piece of code that don't update the database... Could somebody tel me why it doesn't run??

Dim conn As SqlConnection
        Dim cmd As SqlCommand
        Dim cmdstring As String = "Update Corsi Set [Contenuto]='" & TxtText.Content & "' Where [ID]='" & Request.QueryString("Id").Replace("'", "") & "'"
        conn = New SqlConnection(SqlAnni.ConnectionString)
        cmd = New SqlCommand(cmdstring, conn)

Need help with a linq to sql query

  

I want to display some stats in a listview contril.  The table contains a record for every impression and for every click, and every record has a datetime field for the time and date of the impression of click.  I want to be able to display how many impressions and clicks there were in a given day and hour, something like below:


Date              Time                              Impressions    Clicks
8/20/2010                                               450              14            
                     Midnight -1:00am               150               5
&n

How to send an email with information in query string

  

First I will say I googled (Binged to make Bill happy) for this but could not find anything, perhaps I am not stating what I need correctly;

I have a website that a customer creates orders (for a printing company) and after the order, I would like to email the customer a link to view the status of their order;

I need to send the CustomerID in the link so on the returning page if a CustomerID is detected in the querystring, I "auto login" the client and open the "Dashboard" for the order page for that customer.

Can anyone point me in the right direction as to how to send the link and how to parse the querystring to get the values from the link;

Thank you if you can point me in the right direction.


MDX Query parameter from SSRS

  

Hello,
I've a MDX Query that has where clause as shown below.
I'm designing report using SSRS 2008. How can i pass date as parameter ? I tried to setup @from and @to as parameter but not working ?
any ideas....

WHERE ( {[Date Central].[Calendar Date].[2010-04-01 00:00:00]:[Date Central].[Calendar Date].[2010-08-30 00:00:00]} )

need it to work as
WHERE ( {[Date Central].[Calendar Date].[@From]:[Date Central].[Calendar Date].[@To]} )

 

 


Get ServerReport selected Parameter value to use in vb query

  

I'm using ReportViewer in Asp.net 2.0 to view a SSRS report. I need the value of the selected parameter to use in a vb query. The parameters are populated on the server and its a single selection. Doing searches I've come across  ReportViewer1.ServerReport.GetParameters() but I can't figure out if I can use this to determine which value the user has selected in the parameter dropdownlist. Any help would be appreciated.


Need Help in LINQ query for group By with chunks of record

  

I am assigning and unique id [strShipperIdSequence] on my List on bases of some properties which are grouped together uniquely.
Now what i needed is that my group should be further break down to some maximum amount of chunks.[Let say 10]
that mean's even i am having Same value in 12 records i should get 2 groups[I of 10 items and other of 2 items]

var uniqueGroups = objMdbContentInfoList.GroupBy(p => new
{
p.CON_ENTRY_POINT,
p.APPTType,
p.CON_CONTAINER_ISSUE_DATE
}).Select(g => g.First()).ToList();
foreach (var objUnique in uniqueGroups)
{
string strShipperIdSequence = APIGlobalMethods.GetShipperRequestID();
foreach (MdbContentInfo obj in objMdbContentInfoList.FindAll(h => (h.CON_ENTRY_POINT == objUnique.CON_ENTRY_POINT &&
h.APPTType == objUnique.APPTType &&
h.CON_CONTAINER_ISSUE_DATE == objUnique.CON_CONTAINER_ISSUE_DATE)))
{
obj.Shipper

Query an arraylist of array list using linq

  

I have an array list called Customer. I t holds a list of array list which has the account details.

proj.customer -> collection of arraylist of type customer

proj.customer.account -> collection of arraylist of type account


Account array list holds type account and it has a poperty account balance. How can I query all accounts which has account balance  >100


I tried the following one

var Accountlist= from Account accountdetails in proj.customer.account

where accountid.balance >100

select accountdetails.id

But it is always throwing an error saying cannot cast type customer to type account

Please help


Basic Instincts: Increase LINQ Query Performance

  

Jared Parsons demonstrates a technique to achieve maximum performance from LINQ queries on large sets of data in order to create a responsive user interface.

Jared Parsons

MSDN Magazine August 2008


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend