CAML query performance for large lists
I have a list with more than 10000 items. I am retrieving the items and displaying it in a RAD Grid on my page using CAML query. While retrieving the items, around 1000 records are retrieved due to filter. I have enabled paging in my grid and PageSize is
set to 25. I have noticed that the load time of my page is very slow as it retrieves all the 1000 records at once.
Is it possible to retrieve just 25 records for the first page on load. On click on the Next button or Page number it should retrieve the next set of 25 records for that particular page.
I want to know if there is any way to link CAMl query paging with RAD grid paging
Any code example would be greatly helpful.
Hi,
For pagination in SPListItem use the SPQuery.ListItemCollectionPosition property.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.listitemcollectionposition(v=office.15).aspx
check the usefull urls
http://omourad.blogspot.in/2009/07/paging-with-listitemcollectionposition.html
http://www.anmolrehan-sharepointconsultant.com/2011/10/client-object-model-access-large-lists.html
Anil
Similar Messages
-
CAML Query for Large List.
Hi All,
I am having list in which there are more 60000 items in to it. Can you guys please help me out that what is the best practice to execute query on such large list ?
Is it a good way to increase thresold limit ? I don't think so. What else I can do ?
Any idea ? Please suggest.
Thanks in advance.Hi Jaydeep,
I'hv updated my code as per your link described : but still its showing an error. Below I am pasting my source code.
Below is my code :
SPList list = spWeb.Lists.TryGetList("ListName");
SPQuery query = new SPQuery();
//query.QueryThrottleMode = SPQueryThrottleOption.Override;
query.Query = @"<Where>
<Eq>
<FieldRef Name='TCode' />
<Value Type='Text'>" + tcode + @"</Value>
</Eq>
</Where>";
query.ViewAttributes = "Scope=\"Recursive\"";
query.RowLimit = 200;
do
SPListItemCollection itemCollcetion = list.GetItems(query);
foreach (SPListItem item in itemCollcetion)
if (!tRoles.Contains(item["Title"].ToString()))
tRoles.Add(item["Title"].ToString());
query.ListItemCollectionPosition = itemCollcetion.ListItemCollectionPosition;
} while (query.ListItemCollectionPosition != null);
Limit it set to 10000 records and my list is having 13000 records. Above code executes under run with elevated previliges.
Any suggestions ?
Thanks in advance. -
How to improve Query performance on large table in MS SQL Server 2008 R2
I have a table with 20 million records. What is the best option to improve query performance on this table. Is partitioning the table into filegroups is a best option or splitting the table into multiple smaller tables?
Hi bala197164,
First, I want to inform that both to partition the table into filegroups and split the table into multiple smaller tables can improve the table query performance, and they are fit for different situation. For example, our table have one hundred columns and
some columns are not related to this table object directly (for example, there is a table named userinfo to store user information, it has columns address_street, address_zip,address_ province columns, at this time, we can create a new table named as Address,
and add a foreign key in userinfo table references Address table), under this situation, by splitting a large table into smaller, individual tables, queries that access only a fraction of the data can run faster because there is less data to scan. Another
situation is our table records can be grouped easily, for example, there is a column named year to store information about product release date, at this time, we can partition the table into filegroups to improve the query performance. Usually, we perform
both of methods together. Additionally, we can add index to table to improve the query performance. For more detail information, please refer to the following document:
Partitioning:
http://msdn.microsoft.com/en-us/library/ms178148.aspx
CREATE INDEX (Transact-SQL):
http://msdn.microsoft.com/en-us/library/ms188783.aspx
TechNet
Subscriber Support
If you are
TechNet Subscription user and have any feedback on our support quality, please send your feedback
here.
Allen Li
TechNet Community Support -
Java library for large list sorts in small amount of memory
Hi All
Wondering whether anybody would know of a ready made java library for sorting large lists of objects. We will write ourselves if necessary but I'm hoping this is the sort of problem that has been solved a million times and may hopefully have been wrapped behind some nice interface
What we need to do is something along the line of:
Load a large list with objects (duh!)
If that list fits into an allowed amount of memory great. Sort it and end of story.
If it won't then have some mechanism for spilling over onto disk and perform the best sort algorithm possible given some spill over onto disk.
These sorts need to be used in scenarios such as a random selection of 10% of the records in a 100G unsorted file and delivered sorted, with the jobs doing the sorts being limited to as little as 64MB of memory (these are extremes but ones that happen quite regularly).
Some of you might think "just use a database". Been there. Done that. And for reasons beyond the scope of this post its a no goer.
Thanking you for all your help in advance.Of course this kind of sorting was common back in days of yore when we had mainframes with less than 1MB or ram.
The classic algorithm uses serveral files.
1) Load as much as will fit
2) sort it
3) Write it to a temporary file
4) Repeat from 1, altnerating output between two or three temp files.
Your temporary files then each contain a series of sorted sequences (try saying that three times fast).
You then merge these sequences into longer sequences, creating more temp files. Then merge the longer sequences into even longer ones, and so on until you're left with just the one sequence.
Merging doesn't require any significant memory use however long the sequences. You only need to hold one record from each temp file being merged. -
CAML Query to Sort SharePoint list items based on Modified date
hi ,
can we sort sharePoint list items based on 'Modified' column, the sorting should be done up to milliseconds level.
currently i am using CAML query as below
<OrderBy><FieldRef Name='Modified' Type='DateTime' IncludeTimeValue='TRUE' Ascending='False'/></OrderBy>but its not considering milliseconds while sorting.
Thanks and Regards,
venkatesh.Veda, thanks but I'm not really a hardcore C# coder.
We found more elegant solution was to create a List View which returns all records that should be deleted, based on our own custom deletion criteria, and then create an very simple SSIS Package in Visual Studio using the
Sharepoint Connectors for SSIS to delete all Sharepoint List Items returned from that List View. The Sharepoint Destination Connector has a delete operation.
This worked for us and didn't require any coding. -
Query Performance for OLE DB OLAP Reporting
Hi Experts,
what are the advantages of enhancing query performance by
A) building Aggregates or
B) using Information Broadcaster Query Precalculation?
Since the settings in Information Broadcaster could be done by any user - will the precalculated version be used only for this user or for all users exeucting the query?
Are these settings also used if the query is executed via a 3rd party Frontend tool?
Thanks,
AngieHi Angie,
Which is the third party tool that's accessing the query? Is it BO? If so there's a lot of information available. -
Query performance for WEBI on top of BEx
Hello Everyone,
Is there a way to get the time taken by a webi query execution on the BO side and in the BW side? Is this stat stored some where?
Also, what is the best approach to take for comparing performance between the original bex query and the WEBI on top of the Bex?
Thanks for your help.
AashishHi,
i posted some links for the same Question here:
Poor query performance in WebI on top of BEx queries
Maybe those can help you.
Regards
-Seb. -
Slow performance for large queries
Hi -
I'm experiencing slow performance when I use a filter with a very large OR clause.
I have a list of users, whose uid's are known, and I want to retrieve attributes for all users. If I do this one at a time, I pay the network overhead, and this becomes a bottleneck. However, if I try to get information about all users at once, the query runs ridiculously slow - ~ 10minutes for 5000 users.
The syntax of my filter is: (|(uid=user1)(uid=user2)(uid=user3)(uid=user4).....(uid=user5000))
I'm trying this technique because it's similar to good design for oracle - minimizing round trips to the database.
I'm running LDAP 4.1.1 on a Tru64 OS - v5.1.This is a performance/tuning forum for iPlanet Application Server. You'd have better luck with this question on the Directory forum.
The directory folks don't have a separate forum dedicated to tuning, but they answer performance questions in the main forum all of the time.
David -
Dear friend,
My view always shows timeout because my table is now having 18,00,000 data row.
Now what should I do with this table? can anyone help me?
another question is, in my work purpose I need to create 5-7 report every day. So every time I need to create view for those report. I can not create procedure always because creating view is easier for me. But the views become slower day by day. My
server is I think quiet good. Xeon cuad core dual processor and Ram is 32.
Is advice will be appreciated.
Thanks in advanceYa thanks for your time. I am appreciating all the way.
Actually I attach those for present an idea about my database. Most of the time I need to work with just 3 or 4 table which is LC_Profile and student_profile or ROSC database.
I am adding the query but you do not need to go all the query. Just understand how difficult my query use to be. My question is there good way to get result faster than the view?I need to make several report every day. So I use view and join many tables
and need to use many where clause, case, convert time etc. That is why I am asking for suggestion.
SELECT TOP (100) PERCENT dbo.ACF_LCs.YearTrim, dbo.ACF_LCs.EduYr, dbo.vw_Geocode.DivisionID, dbo.vw_Geocode.DivisionB, dbo.vw_Geocode.Division,
dbo.vw_Geocode.DistrictID, dbo.vw_Geocode.District, dbo.vw_Geocode.DistrictB, dbo.vw_Geocode.UpazilaID, dbo.vw_Geocode.Upazila, dbo.vw_Geocode.UpazilaB,
dbo.LCProfile.LCID, dbo.LCProfile.LCYr, dbo.LCProfile.LCNm, dbo.LCProfile.LCNmB, dbo.Vw_Teacher_Active.TeachYr, dbo.Vw_Teacher_Active.TeachEdu,
CASE WHEN TeachEdu = 1 THEN 3000 ELSE 3000 END AS TeacherSalaryOld, dbo.LCProfile.LCAccountNo, dbo.Vw_Teacher_Active.TeachNm,
dbo.Vw_Teacher_Active.TeachSex, dbo.vw_Bank_Branch.LCBankBr, dbo.Vw_Teacher_Active.TeachMob, dbo.LCProfile.UnionID, dbo.UnionCode.UnionB,
dbo.LCProfile.LCVill, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID AS MDistrictID,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID AS MUpazilaID, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID AS MLCID,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.MOID,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCStatus, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LC1stVstDt,
MonitoringROSCII.dbo.Venu_Info.VenuType, MonitoringROSCII.dbo.Venu_Info.VenuTypeOthr, MonitoringROSCII.dbo.Venu_Info.NoWindow,
MonitoringROSCII.dbo.Venu_Info.SuffWinAir, MonitoringROSCII.dbo.Venu_Info.FreeArsWater, MonitoringROSCII.dbo.Venu_Info.HigLatrin,
MonitoringROSCII.dbo.Venu_Info.SeatArg, MonitoringROSCII.dbo.Venu_Info.Blackboard, MonitoringROSCII.dbo.Venu_Info.DistrictID AS VDistrictID,
MonitoringROSCII.dbo.Venu_Info.UpazilaID AS VUpazilaID, MonitoringROSCII.dbo.Venu_Info.LCID AS VLCID,
MonitoringROSCII.dbo.Vw_UniformYes.DistrictID AS UDistrictID, MonitoringROSCII.dbo.Vw_UniformYes.UpazilaID AS UUpazilaID,
MonitoringROSCII.dbo.Vw_UniformYes.LCID AS ULCID, MonitoringROSCII.dbo.Vw_UniformYes.RecUniformY,
MonitoringROSCII.dbo.Teacher_Training.DistrictID AS TDistrictID, MonitoringROSCII.dbo.Teacher_Training.UpazilaID AS TUpazilaID,
MonitoringROSCII.dbo.Teacher_Training.LCID AS TLCID, MonitoringROSCII.dbo.Teacher_Training.TcrRecFndTrn, MonitoringROSCII.dbo.LC_Info.PrsnMale,
MonitoringROSCII.dbo.LC_Info.PrsnFemale, MonitoringROSCII.dbo.LC_Info.PrsnStdTot, RIGHT('00' + CONVERT(varchar, dbo.vw_Geocode.DivisionID), 2)
+ RIGHT('00' + CONVERT(varchar, dbo.vw_Geocode.DistrictID), 2) + RIGHT(CONVERT(varchar, dbo.vw_Geocode.UpazilaID), 2) + RIGHT('000' + CONVERT(varchar,
dbo.Vw_Teacher_Active.LCID), 3) AS InstituteID, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCStartHr,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCEndHr, dbo.Vw_LCProfile_QStudent_LCwise2013_3.NoStudent AS NoQStudent,
dbo.Vw_LCProfile_QStudent_LCwise2013_3.Stu13, dbo.Vw_LCProfile_QStudent_LCwise2013_3.Stu45, dbo.PO.PO_NM_E, dbo.PO.PO_NM_B,
dbo.vw_Geocode.Status AS UpStatus, dbo.vw_Geocode.Phase, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.SpecialStatus,
dbo.ACF_LCs.SpecialStatus AS SpecialStatusACF, MonitoringROSCII.dbo.Teacher_Profile.TcrPres, MonitoringROSCII.dbo.Teacher_Profile.TcrMtchLCProf,
CASE WHEN NOT (MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID IS NULL) AND LCStatus = 1 AND ((TcrPres = 1 AND TcrMtchLCProf = 2) OR
TcrPres = 2) THEN 0 ELSE 3000 END AS TeacherSalary
FROM dbo.Vw_Teacher_Active RIGHT OUTER JOIN
dbo.PO RIGHT OUTER JOIN
dbo.vw_LC_Functioning RIGHT OUTER JOIN
dbo.Vw_LCProfile_QStudent_LCwise2013_3 INNER JOIN
dbo.ACF_LCs INNER JOIN
dbo.vw_Geocode INNER JOIN
dbo.LCProfile ON dbo.vw_Geocode.DistrictID = dbo.LCProfile.DistrictID AND dbo.vw_Geocode.UpazilaID = dbo.LCProfile.UpazilaID ON
dbo.ACF_LCs.DistrictID = dbo.LCProfile.DistrictID AND dbo.ACF_LCs.UpazilaID = dbo.LCProfile.UpazilaID AND dbo.ACF_LCs.LcID = dbo.LCProfile.LCID ON
dbo.Vw_LCProfile_QStudent_LCwise2013_3.DistrictID = dbo.ACF_LCs.DistrictID AND
dbo.Vw_LCProfile_QStudent_LCwise2013_3.UpazilaID = dbo.ACF_LCs.UpazilaID AND dbo.Vw_LCProfile_QStudent_LCwise2013_3.LCID = dbo.ACF_LCs.LcID ON
dbo.vw_LC_Functioning.DistrictID = dbo.ACF_LCs.DistrictID AND dbo.vw_LC_Functioning.UpazilaID = dbo.ACF_LCs.UpazilaID AND
dbo.vw_LC_Functioning.LCID = dbo.ACF_LCs.LcID LEFT OUTER JOIN
MonitoringROSCII.dbo.Teacher_Training RIGHT OUTER JOIN
MonitoringROSCII.dbo.Venu_Info RIGHT OUTER JOIN
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo LEFT OUTER JOIN
MonitoringROSCII.dbo.Teacher_Profile ON MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID = MonitoringROSCII.dbo.Teacher_Profile.DistrictID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID = MonitoringROSCII.dbo.Teacher_Profile.UpazilaID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID = MonitoringROSCII.dbo.Teacher_Profile.LCID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType = MonitoringROSCII.dbo.Teacher_Profile.VisitType AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr = MonitoringROSCII.dbo.Teacher_Profile.LCVisitYr AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister = MonitoringROSCII.dbo.Teacher_Profile.Trimister ON
MonitoringROSCII.dbo.Venu_Info.DistrictID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID AND
MonitoringROSCII.dbo.Venu_Info.UpazilaID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID AND
MonitoringROSCII.dbo.Venu_Info.LCID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID AND
MonitoringROSCII.dbo.Venu_Info.VisitType = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType AND
MonitoringROSCII.dbo.Venu_Info.LCVisitYr = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr AND
MonitoringROSCII.dbo.Venu_Info.Trimister = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister LEFT OUTER JOIN
MonitoringROSCII.dbo.Vw_UniformYes ON MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID = MonitoringROSCII.dbo.Vw_UniformYes.DistrictID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID = MonitoringROSCII.dbo.Vw_UniformYes.UpazilaID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID = MonitoringROSCII.dbo.Vw_UniformYes.LCID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType = MonitoringROSCII.dbo.Vw_UniformYes.VisitType AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr = MonitoringROSCII.dbo.Vw_UniformYes.LCVisitYr LEFT OUTER JOIN
MonitoringROSCII.dbo.LC_Info ON MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID = MonitoringROSCII.dbo.LC_Info.DistrictID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID = MonitoringROSCII.dbo.LC_Info.UpazilaID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID = MonitoringROSCII.dbo.LC_Info.LCID AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType = MonitoringROSCII.dbo.LC_Info.VisitType AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr = MonitoringROSCII.dbo.LC_Info.LCVisitYr AND
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister = MonitoringROSCII.dbo.LC_Info.Trimister ON
MonitoringROSCII.dbo.Teacher_Training.DistrictID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID AND
MonitoringROSCII.dbo.Teacher_Training.UpazilaID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID AND
MonitoringROSCII.dbo.Teacher_Training.LCID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID AND
MonitoringROSCII.dbo.Teacher_Training.VisitType = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType AND
MonitoringROSCII.dbo.Teacher_Training.LCVisitYr = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr AND
MonitoringROSCII.dbo.Teacher_Training.Trimister = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister ON
dbo.ACF_LCs.DistrictID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID AND
dbo.ACF_LCs.UpazilaID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID AND
dbo.ACF_LCs.LcID = MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID ON dbo.PO.DistrictID = dbo.LCProfile.DistrictID AND
dbo.PO.UpazilaID = dbo.LCProfile.UpazilaID ON dbo.Vw_Teacher_Active.DistrictID = dbo.LCProfile.DistrictID AND
dbo.Vw_Teacher_Active.UpazilaID = dbo.LCProfile.UpazilaID AND dbo.Vw_Teacher_Active.LCID = dbo.LCProfile.LCID LEFT OUTER JOIN
dbo.UnionCode ON dbo.LCProfile.UnionID = dbo.UnionCode.UnionID AND dbo.LCProfile.UpazilaID = dbo.UnionCode.UpazilaID AND
dbo.LCProfile.DistrictID = dbo.UnionCode.DistrictID LEFT OUTER JOIN
dbo.vw_Bank_Branch ON dbo.LCProfile.LCBankBr = dbo.vw_Bank_Branch.BranchID
GROUP BY dbo.vw_Geocode.DivisionID, dbo.vw_Geocode.DivisionB, dbo.vw_Geocode.DistrictID, dbo.vw_Geocode.DistrictB, dbo.vw_Geocode.UpazilaID,
dbo.vw_Geocode.UpazilaB, dbo.LCProfile.LCID, dbo.LCProfile.LCYr, dbo.LCProfile.LCNmB, dbo.Vw_Teacher_Active.TeachEdu, dbo.LCProfile.LCAccountNo,
dbo.Vw_Teacher_Active.TeachNm, dbo.Vw_Teacher_Active.TeachSex, dbo.vw_Bank_Branch.LCBankBr, dbo.UnionCode.UnionB, dbo.vw_Geocode.Division,
dbo.vw_Geocode.District, dbo.vw_Geocode.Upazila, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.DistrictID,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.UpazilaID, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.MOID,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCStatus, MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LC1stVstDt,
MonitoringROSCII.dbo.Venu_Info.NoWindow, MonitoringROSCII.dbo.Venu_Info.SuffWinAir, MonitoringROSCII.dbo.Venu_Info.FreeArsWater,
MonitoringROSCII.dbo.Venu_Info.HigLatrin, MonitoringROSCII.dbo.Venu_Info.SeatArg, MonitoringROSCII.dbo.Venu_Info.Blackboard,
MonitoringROSCII.dbo.Venu_Info.DistrictID, MonitoringROSCII.dbo.Venu_Info.UpazilaID, MonitoringROSCII.dbo.Venu_Info.LCID,
MonitoringROSCII.dbo.Venu_Info.VenuType, MonitoringROSCII.dbo.Venu_Info.VenuTypeOthr, MonitoringROSCII.dbo.Vw_UniformYes.RecUniformY,
MonitoringROSCII.dbo.Vw_UniformYes.DistrictID, MonitoringROSCII.dbo.Vw_UniformYes.UpazilaID, MonitoringROSCII.dbo.Vw_UniformYes.LCID,
MonitoringROSCII.dbo.Teacher_Training.DistrictID, MonitoringROSCII.dbo.Teacher_Training.UpazilaID, MonitoringROSCII.dbo.Teacher_Training.LCID,
MonitoringROSCII.dbo.Teacher_Training.TcrRecFndTrn, dbo.LCProfile.UnionID, MonitoringROSCII.dbo.LC_Info.PrsnMale, MonitoringROSCII.dbo.LC_Info.PrsnFemale,
MonitoringROSCII.dbo.LC_Info.PrsnStdTot, dbo.LCProfile.LCVill, dbo.Vw_Teacher_Active.TeachMob, RIGHT('00' + CONVERT(varchar, dbo.vw_Geocode.DivisionID), 2)
+ RIGHT('00' + CONVERT(varchar, dbo.vw_Geocode.DistrictID), 2) + RIGHT(CONVERT(varchar, dbo.vw_Geocode.UpazilaID), 2) + RIGHT('000' + CONVERT(varchar,
dbo.Vw_Teacher_Active.LCID), 3), MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCStartHr,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCEndHr, dbo.Vw_LCProfile_QStudent_LCwise2013_3.NoStudent, dbo.PO.PO_NM_E, dbo.PO.PO_NM_B,
dbo.vw_Geocode.Status, dbo.vw_Geocode.Phase, dbo.Vw_Teacher_Active.TeachYr, dbo.LCProfile.LCNm,
MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.SpecialStatus, dbo.ACF_LCs.YearTrim, dbo.ACF_LCs.EduYr,
dbo.Vw_LCProfile_QStudent_LCwise2013_3.Stu13, dbo.Vw_LCProfile_QStudent_LCwise2013_3.Stu45, dbo.ACF_LCs.SpecialStatus,
MonitoringROSCII.dbo.Teacher_Profile.TcrPres, MonitoringROSCII.dbo.Teacher_Profile.TcrMtchLCProf,
CASE WHEN NOT (MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID IS NULL) AND LCStatus = 1 AND ((TcrPres = 1 AND TcrMtchLCProf = 2) OR
TcrPres = 2) THEN 0 ELSE 3000 END
HAVING (dbo.ACF_LCs.YearTrim = 1) AND (dbo.ACF_LCs.EduYr = 2014) AND (dbo.LCProfile.LCYr < 2013) AND
(MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCVisitYr = 2014) AND (MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.Trimister = 1) AND
(MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.VisitType = 3) AND (NOT (MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID IS NULL)) OR
(dbo.ACF_LCs.YearTrim = 1) AND (dbo.ACF_LCs.EduYr = 2014) AND (dbo.LCProfile.LCYr < 2013) AND
(MonitoringROSCII.dbo.VwComplianceMonitoringBasicInfo.LCID IS NULL)
ORDER BY dbo.vw_Geocode.DivisionID
Another problem is ,
Lets say I have a table with id, name, place,address, timeof_attendance and an id which is big int type. This table have 18,00,000 record. and each day increasing with 5000 record. From there I am finding the attandance in every day. So I have to create
4 nested view to come to a result. Now My query shows timeout. If I delete old data then it works. This kind of problem I am facing.
Please advice me.
Thanks -
CSOM (Javascript) Inner join CAML query on 'User Information List'
I need to pull site user details like (email, display name, phone) from 'User information list' using a 'inner join' on a different list 'SiteOwners' where 'Contact' is a person or group field.
The result object is not returning the details from 'User Information List' though it returns details from 'SiteOwners' list
<script src="/_layouts/15/SP.runtime.js" type="text/javascript"></script>
<script src="/_layouts/15/SP.js" type="text/javascript"></script>
<script type='text/javascript'>
'use strict';
//$(document).ready(function() {
function abc() {
var context = SP.ClientContext.get_current();
var web =context.get_web();
var stownrlist = web.get_lists().getByTitle('SiteOwners');
var camlqry = new SP.CamlQuery();
camlqry.set_viewXml = "<View>" +
"<Query></Query>" +
"<ViewFields>" +
"<FieldRef Name='Title'/>" +
"<FieldRef Name='Contact'/>" +
"<FieldRef Name='UserName'/>" +
"<FieldRef Name='UserEMail'/>" +
"<FieldRef Name='UserMobilePhone'/>" +
"</ViewFields>" +
"<ProjectedFields>" +
"<Field Name='UserName' Type='Lookup' List='User Information List' ShowField='Name' />" +
"<Field Name='UserEMail' Type='Lookup' List='User Information List' ShowField='EMail' />" +
"<Field Name='UserMobilePhone' Type='Lookup' List='User Information List' ShowField='MobilePhone' />" +
"</ProjectedFields>" +
"<Joins>" +
"<Join Type='INNER' ListAlias='User Information List'>" +
"<Eq>" +
"<FieldRef Name='Contact' RefType='Id'/>" +
"<FieldRef List='User Information List' Name='ID'/>" +
"</Eq>" +
"</Join>" +
"</Joins>" +
"</View>";
debugger;
var stownritems = stownrlist.getItems(camlqry);
context.load(stownritems);//, 'Include(Title,Contact,UserName,UserEMail,UserMobilePhone)');
context.executeQueryAsync(
Function.createDelegate(this, function () {
debugger;
var stownenm = stownritems.getEnumerator();
while (stownenm.moveNext()) {
var userid, loginname,email,name,mobilephone;
if (stownenm.get_current().get_item('Contact') != null) {
userid = stownenm.get_current().get_item('Contact').get_lookupId();
loginname = stownenm.get_current().get_item('Contact').get_lookupValue();
email = stownenm.get_current().get_item('ows_UserEMail');
name = stownenm.get_current().get_item('UserName');
mobilephone = stownenm.get_current().get_item('UserMobilePhone');
}), function() {alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());});
</script>
Any suggestions / help please.
SaiI identified the issue
"camlqry.set_viewXml" is a method (camlqry.set_viewXml()) not a property (as apposed to C#).
The above should be like "camlqry.set_viewXml(querystring)" instead of "camlqry.set_viewXml =qrystring".
Sai -
Performance for large scale of objects
I'm working on a project that requires thousands of buttons to be shown on a page. Each button presents an object instance. It tooks more than 20 seconds to display the page. Is there any way to improve the performance? or any other faster approaches? Thanks.
Thank for your reply. I should have described my question clearer.
I'm using commandButton on a JSP as one of the graphic view of my JSF application. There is only one data bean class on the server for this view and I create a button for each instance of the bean class. Is JavaScript on the client-side a good idea, but its appearance may vary for different browsers, if I understand it correctly.
With thousands of buttons I have to use scroll bar on the content area that contains the buttons. One approach that I'm thinking is to implement the scrolling function in a way similar to the paginating function - loads only the data needed for the display area. Whenever the scroll bar is clicked, I will load a new set of data just sufficient for the display. Is this a possible approach? -
CAML query performance benchmark
Hi All,
My company has recently moved to MS technology and our portal has been developed using .Net and SharePoint 2010 to replace our old system that is based on Oracle 11g and Oracle forms.
The main observation that we have is that CAML queries are much slower than their equivalent Oracle query or even a direct SQL (just for testing).
To investigate CAML query performance we choose a list of CAML queries that we execute in our portal and (just for testing) wrote the equivalent direct SQL statements and tried both in similar network conditions to discover that CAML is at least 10 times
slower than the direct SQL!
We are suspecting that our CAML queries are not efficient (especially when join is needed) but some sample queries are direct selects with the same ration 10:1!
We need an expert advice to know whether this is the normal benchmark and what to do about it:
move part of the schema to a relational database (SQL or Oracle)
replace the CAML with SharePoint Library Query
replace the CAML with direct SQL (I read several articles about how this is considered a taboo but the current performance is not acceptable at all especially when there is a system that works with older technology that is performing much
faster)
One of the examples:
CAML:
<Where><Contains><FieldRef Name="ECM_F_BarcodeNo" /><Value Type="Text">-01-</Value></Contains></Where>
SQL:
Select *
From UserData
As Doc where
Doc.nvarchar10
like '%-01-%'
Many thanksHi,
Please check those links
http://charliedigital.com/2013/12/05/a-simple-way-to-improve-caml-query-performance/
http://apmblog.compuware.com/2010/03/18/how-to-avoid-the-top-5-sharepoint-performance-mistakes/
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/909b8855-efea-4ee9-b63a-d021b3d416a7/sharepoint-2010-caml-query-performance-list-layout-and-design
http://sharepoint.stackexchange.com/questions/43885/caml-vs-linq-vs-sql
Tool to generate CAML queries
https://spcamlqueryhelper.codeplex.com/
https://camlex.codeplex.com/
Kind Regards,
John Naguib
Technical Consultant/Architect
MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
Please remember to mark your question as answered if this solves your problem -
Query Performance Issues on a cube sized 64GB.
Hi,
We have a non-time based cube whose size is 64 GB . Effectively, I can't use time dimension for partitioning. The transaction table has ~ 850 million records. We have 20+ dimensions among which 2 of the dimensions have 50 million records.
I have equally distributed the fact table records among 60 partitions. Each partition size is around 900 MB.
The processing of the cube is not an issue as it completes in 3.5 hours. The issue is with the query performance of the cube.
When an MDX query is submitted, unfortunately, in majority of the cases the storage engine has to scan all the partitions (as our cube is not time dependent and we can't find a suitable dimension that will fit the bill to partition measure group based
on it.)
I'm aware of the cache warming and usage based aggregation(UBO) techniques.
However, the cube is available for users to perform adhoc queries and hence the benefits of cache warming and UBO may cease to contribute to the performance gain as there is a high probability that each user may look at the data from different perspectives
(especially when we have 20 + dimensions) as day(s) progress.
Also, we have 15 + average calculations (calculated measures) in the cube. So, the storage engine sends all the granular data that the formula engine might have requested (could be millions of rows) and then perform the average calculation.
A look at the profiler suggested that considerable amount of time has been spent by storage engine to gather the records (from 60 partitions).
FYI - Our server has RAM 32 GB and 8 cores and it is exclusive to Analysis Services.
I would appreciate comments from anyone who has worked on a large cube that is not time dependent and the steps they took to improve the adhoc query performance for the users.
Thanks
CoolPHello CoolP,
Here is a good articles regarding how to tuning query performance in SSAS, please see:
Analysis Services Query Performance Top 10 Best Practices:
http://technet.microsoft.com/en-us/library/cc966527.aspx
Hope you can find some helpful clues to tuning your SSAS Server query performance. Moreover, there are two ways to improve the query response time for an increasing number of end-users:
Adding more power to the existing server (scale up)
Distributing the load among several small servers (scale out)
For detail information, please see:
http://technet.microsoft.com/en-us/library/cc966449.aspx
Regards,
Elvis Long
TechNet Community Support -
CAML Query to get Items based on Year and Month From Date Column
Hi All,
* As we knew that there are default columns in calendar like Stattdate,Title,Location..etc.
* I required the CAML Query to get the list items of calender of particular Month and Year,So that I can get number of items or evetns are in Calendar
Can any one help me how can I do this using caml query
SamarHi Stuart,
Thanks for your response,I had chosen 2nd option of our above mention suggestion.But when I try to fetech the data from a calendar it is showing below error .I
had checked the below code with oter lists by changing Type to text and it worked fine.Can you please help me how can I fetech for the calulated columns
Error
"One or more field
types are not installed properly. Go to the list settings page to delete these
fields. "
Code:
string year="2014";
string month="February";
SPSite mysite = SPContext.Current.Site;
SPWeb myweb = mysite.OpenWeb();
try
SPList mylist = myweb.Lists["Calendar"];
SPQuery myquery = new SPQuery();
myquery.Query = @"<Where>
<And>
<Eq>
<FieldRef Name='Year'/>
<Value Type='Calculated'>"
+ year + @"</Value>
</Eq>
<Eq>
<FieldRef Name='Month'
/>
<Value Type='Calculated'>"
+ month + @"</Value>
</Eq>
</And>
</Where>";
SPListItemCollection totaltiems = mylist.GetItems(myquery);
Label1.Text= "Total Number of Items is "+" "+totaltiems.Count.ToString();
catch (Exception ee)
Label1.Text = ee.Message;
finally
myweb.Dispose();
Calculated Columns
Samar -
Problem with caml query in javascript
hi friends
i am using caml query to retrieve single list item
ReviewQuery.set_viewXml('<view><query><Where><Eq><FieldRef Name=\'PNet_x002d_No\' /><Value Type=\'Text\'>'+id123+'</Value></Eq></Where></query></view>');
my problem is if quried id is available in list it is showing properly. but if queried item is not there then it is showing other item in it.Hi,
I suggest you debug the code and check if the variable value is valid.
Here is a code snippet for your reference :
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("callCSOM");
function callCSOM()
$("#Button1").click(function()
// Make sure the SharePoint script file 'sp.js' is loaded before your code runs.
ExecuteOrDelayUntilScriptLoaded(sharePointReady, "sp.js");
function sharePointReady()
getListItems();
var clientContext;
var currentUser;
var targetWeb;
var message = "Web retrieved:";
function getListItems()
// Create an instance of the current context to return context information
clientContext = SP.ClientContext.get_current();
//Returns the list with the specified title from the collection
var oList = clientContext.get_web().get_lists().getByTitle('list');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(‘<ViewFields><FieldRef Name='Title' /></ViewFields><Where> <Eq><FieldRef Name='Title' /><Value Type='Text'>12</Value></Eq> </Where>');
this.collListItem = oList.getItems(camlQuery);
clientContext.load(collListItem);
clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);
function onRequestSucceeded()
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext())
//Gets the current element in the collection
var oListItem = listItemEnumerator.get_current();
message += '___'+'Title: ' + oListItem.get_item('Title');
message += '___'+'ID: ' + oListItem.get_item('ID');
message += '________________________________________________';
$("#div1").text(message);
//the delegate of the method that is called when the request is executed unsuccessfully
function onRequestFailed(sender, args)
alert('Error: ' + args.get_message());
</script>
<input id="Button1" type="button" value="Run Code"/>
<p/>
<div id="div1">test</div>
Also, you can build CAML Query in the CAML Designer:
http://www.camldesigner.com/
Feel free to reply if the issue still exists.
Best regards
Patrick Liang
TechNet Community Support
Maybe you are looking for
-
Download Error with iTunes 10.2.1 "source file could not be read"
I recently had to restore my iPod due to some issues I was having. After it was done wiping the iPod, a message on my computer told me that after my computer restarted (automatically), I needed to keep my ipod connected so it could re-sync with my ba
-
If I buy Lightroom for PC, can I still use it if I switch to a Mac in the future?
If I buy Lightroom for PC, can I still use it if I switch to a Mac in the future? I want to use Lightroom now, but don't want to pay for it again if I start using a Mac.
-
MacBook Pro boot failure after firmware update
Hello, I've had my MacBook Pro with a solid state harddrive about a month. Tonight I did an update (including a firmware update) and it has failed to boot. The fans run at full speed, but nothing boots. The screen remains blank. What can I do?
-
How to vertically align Prompts on the same line in OBIEE
Can we vertically align "Product Line (Owned)" and "Product Line(Not Owned)" in this Prompt on same vertical line? so that "Product Line(Owned)" can start from the same vertical line where "Product Line(Not Owned)" starts we tried few options by addi
-
Lenovo Beacon Cloud Storage HDMI MP3, DD and DTS Audio Passthrough
Hello, Is there any knowledge on whether it's possible to make the Lenovo Beacon pass DD 5.1(and/or DTS) audio through it's HDMI? I just bought a Beacon and it plays avi files without audio at all, it plays MP4 and MKV with AAC 2ch audio just fine,