Autocomplete Optimization For Large Data Sets?
Jan 7, 2011
I am working on a large project where I have to present efficient way for a user to enter data into a form.
Three of the fields of that form require a value from a subset of a common data source (SQL Table). I used JQuery and JQuery UI to build an autocomplete, which posts to a generic HttpHandler.
Internally the handler uses Linq-to-sql to grab the data required from that specific table. The table has about 10 different columns, and the linq expression uses the SqlMethods.Like() to match the single search term on each of those 10 fields.
The problem is that that table contains some 20K rows. The autocomplete works flawlessly, accept the sheer volume of data introduces deleays, in the vicinity of 6 seconds or so (when debugging on my local machine) before it shows up.
The JqueryUI autocomplete has 0 delay, queries on the 3 key, and the result of the post is made in a Facebook style multi-row selectable options. (I almost had to rewrite the autocomplete plugin...).
So the problem is data vs. speed. Any thoughts on how to speed this up? The only two thoughts I had were to cache the data (How/Where?); or use straight up sql data reader for data access?
View 1 Replies
Similar Messages:
Sep 28, 2010
The website I am working on has a section where users can search for content they have digitally subscribed to. way to cross-check both data sets, the first being content that matches the search criteria, the second being the content the user has subscribed to. What's making this is a mess is how the data is structured. Here is an example...
We store all of our content in a "Content" table in our database. A piece of content, a "journal", for example, and all of its child records (volumes, issues, and articles) are all stored as records in the "Content" table, each with a ParentId of its corresponding parent record. So, A journal can have n volumes. Each volume can have n issues. Each issue can have n articles. A user can have a subscription to any of these, which would implicitly give them access to all child records. For example, if a user was subscribed to a journal, they would have access to all of its volumes, issues, and articles. If the user was subscribed to an issue, they would have access to all of its articles, but not the parent volume or journal.
Some users own over 30,000 records, and we have over 100,000 content records in the database. The Content table has relationships with several other tables that are used for the search. This leaves me with an expensive query to find what the user has access to, and another expensive query to search through all of the records to find search criteria matches. Some of our searches take 20-30 seconds and I would like to speed it up to a max of 5sec per search.
I tried running a query to get the ContentIds of everything the user owned when they first visited the search page, and then caching it to eliminate further database hits, but when I passed the list of ints into the query via a linq .Contains statement, I hit the SQL parameter limit of 2100, since apparently .Contains() splits them all out.
View 3 Replies
Jun 7, 2010
I am developing a website with huge data which to be stored in SQL Server database. How should I optimize it to make it faster.
1. Using Stored procedures.
2. Functions / Views.
3. Any other methods
View 3 Replies
Jan 6, 2011
I am working on a site in which as user logs in (first database request) the stored procedure varify password and user id and then returns user record that I put in session to use next.
After this I do a second db request. it returns addresses of user which I put in cache.
I can get both sets of data (user record and his address from 2nd table) in one database requests.
View 3 Replies
Jun 11, 2010
I have a form where the user enters their first name, last name, email address etc.. and then they also have the ability to enter 'cottages' that they are interested in viewing (ie. The cottage name, cottage address). The user then needs to be able to 'save' this somewhere and enter another cottage into the same form.
Finally the user will submit the form, and all the user details, and cottage details will be emailed to admin.
View 2 Replies
Feb 26, 2010
just starting strongly typed data sets, I have managed to fill my data set and bind the gridview, but now I dont understand where to map the fields ? Inside the business logic layer or presentation layer.
working example to map fields with a select query and with an update .
my code for BLL file
[Code]....
View 7 Replies
Oct 7, 2010
I have a complicated report that nests six deep and so really hits the database hard. I want to use SqlDataReaders NOT DataAdapters and DataSets because I don't want big tables in memory.
MARS can get me the data fast, all from the one connection. But all the examples show it binding to a treeview.
I want to bind it to nested GridViews (six deep!).
Any examples of MARS binding to nested gridview/list/repeater controls of any kind?
View 1 Replies
Mar 22, 2011
I have two SQL queries that are stored procedures that have 2 variables that my web form will be supplying through text boxes. The two queries will produce two different results. I have read a couple of different of the MSDN articles online, including this one:
[URL]
that say that the tables must be similar to be able to merge them into a single datagridview. I know that datagridviews only like one table at a time, but I was curious if anyone had found a way to merge two dissimilar tables to one datagridview or not.
View 7 Replies
Aug 20, 2010
I have a C# website developed with Visual Studio 2008 with a SQL backend. I have a top Navigation menu that has seven different tabs. I have a specific right bar content for each of the seven tabs. The content for the right bar is stored in a sql database and will be accessed using data sets. I believe that I have two ways to display the information with the data set...
1. User control - Create a User Control for each data set and then drop that on to the respective pages.
2. Master Pages - Create a Master Page for each of my seven sections, adding the data set to the respective Master Page.
Is there a preffered approach to achieve my goal? I am thinking Master Pages would be the most efficient but not certain. Is there another method I should consider?
View 1 Replies
Oct 13, 2010
I have a following scenario - A use selects criterias from a webform (C#) - a result is then returned from the sql. Say, to start, there are 2000 data returned from the sql and are stored in a dataset.
Now, the user wants to choose a number of drops (up to 6) - with the number of drops selected, they can enter their own quantity in each box. So, they can divide the 2000 records into 6 different drops. With each drop, there is campaigncode created based on the mail date and the job number they provide.
So, now i have the 2000 records in a dataset. What i want to do is loop through the gridview where the user fill out the quantity depending on the number of drops (for ex: if they say 3 drops, then there will be 3 rows in gridview with 3 quantity box to fill).
In the loop, I am getting the quantity, dropdate and the job number. The Campaigncode is created as well. Then, i am looping through the datarow in the dataset; updating the Campaign Code column with the CampaignCode for the number of records thats set in a loop. It works but the Campaign Code is not populated for the next set of records.
Here is the code:
[Code]....
I think its this line right here thats causing the problem. But i don't know how to tweak this so as to accomplish what i want to do.
if (Convert.IsDBNull(DSAEFile.Tables[0].Rows[i]["Campaign Code"]))
View 3 Replies
May 10, 2010
I have a datalist and now i want to give custome paging to that datalist using multiple active result set. I mean i want to show paging as
first,previous,1 2 3. . . next, last.In this I want to get only 3 pages at a time. and once i got the page, I want to put it in caching and again if user click on that page number then i dont want to get the data from cache instead of hitting the database
View 2 Replies
Sep 29, 2010
I'm creating just simple autocomplete sample.
taking one textbox adding autocomplete extender as
<asp:ScriptManager ID="ScriptManager2" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
</Services>
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server" EnableTheming="True" ></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1" ServiceMethod="GetCountryInfo" ServicePath="WebService.asmx" TargetControlID="TextBox1">
</cc1:AutoCompleteExtender>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
Also creating web services as "WebService.asmx" & code inside this file is that
<%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" %>
------
then in Webservice.cs file i write code as
public class WebService : System.Web.Services.WebService {
MySql.Data.MySqlClient.MySqlCommand cmd = new MySqlCommand();
MySql.Data.MySqlClient.MySqlConnection con = new MySqlConnection();
//MySqlDataAdapter da = new MySqlDataAdapter();
MySqlDataReader dr;
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string[] GetCountryInfo(string prefixText)
{
int count = 10;
string sql = "Select * from tbl_patientmaster Where P_NAME like '" + @prefixText + "%'";
con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["HMSDBConnectionString"].ToString();
con.Open();
MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, con);
da.SelectCommand.Parameters.Add("@prefixText", MySql.Data.MySqlClient.MySqlDbType.VarChar, 50).Value = prefixText + "%";
System.Data.DataTable dt = new System.Data.DataTable();
da.Fill(dt);
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (System.Data.DataRow dr in dt.Rows)
{
items.SetValue(dr["P_NAME"].ToString(), i);
i++;
}
return items;
}
this code is not working
View 1 Replies
Jun 4, 2010
trying to merge two sets of data from a SqlDataAdapter and an OleDataAdapter and then populate a gridview on a button click. If I run just the SqldataAdapter on its own the grid populates as expected. This also applies to the OleDataAdapter. The problem arises when I try to merge the two. I get an empty table, hence dt3 is not populating. The code i'm using is below.Does anyone know why this doesn't work?
[Code]....
View 2 Replies
Feb 26, 2010
I have a question related to MVC2, VS2010, AJAX Minifier 4.0 and Build.
I hope it is ok to ask here since it is related to my MVC2 project and probably other people in this forum might have done something like this.
Some time ago I found
SmallSharpTools Packer.NET in
Scott Hanselman's Blog:
I have been using it to minify and combine JS and CSS files. Not when building the MVC application but using a Console Application.
Now I found that Microsoft Ajax Minifier 4.0 already minifies CSS files.
The results seem good and it is a Codeplex project ... So I am planning to move from Packer.NET to Ajax Minifier.
To reduce the number of requests I combine JS files (usually the JQuery Plugins used into a single file JQuery.Plugins.min.js).
It seems Ajax Minifier does not combine files ...
I can include a class on the MVC project which minifies the files using Ajax Minifier and combines the ones that needs to be combined.
The question is: how to include this on the build process of the MVC Application ...
And how to delete the original files on the build version? I only need to have the minified versions after the build ...
View 1 Replies
Feb 11, 2010
i have two models that represent two related tables:
class Article
{
Guid ID;
Guid AuthorID;
string Title;[code]...
i need to show this view model in a view:
class ArticleWithAuthor
{
string ArticleTitle;[code]...
in a controller for Article i need to create a view model for the given article id. i read somewhere that a good way to create a view model is to write a mapper that translates from model to view model.
my question is:since the mapper needs a model to work with, it seems that i need two database requests: one to retrieve my Article model and the other one to get my Person data to merge them in the model view. this seems inefficient. is there a way to combine these requests and still follow this "Entity Translation Pattern"? i know of course that i can create my view model "manually" by writing a custom LINQ expression but i am trying to follow the MVC guidelines.
View 5 Replies
Jul 21, 2010
I am working on ASP.NET website. I need to post a Question Paper based on following parameters.
University
Branch
Subject
At Present My URL is in the below mentioned format
//localhost/MYASP/Posted?PostId=**
My URL should be in the below mention format after URL Rewriting
//localhost/MYASP/Posted/University/Branch/Subject/TITLEOFThePost
let me know the process of finding my querystring after url rewriting
View 2 Replies
Jan 24, 2011
I am currently working on an c# application that minimizes and combines javascript/css asynchronously in the background to load on to the page which completed. Once the combined minimized file(s) are created, they are saved on to disk and all subsequent requests to the page will load this file.
The reason for this is to assist with performance on the page. I have a concern though, what if the combined file is large, eg 200 kb. Would it be better to combine in to 2 files if this was the case and have 2 separate http requests? The file will be gzipped and cached.
View 3 Replies
Feb 3, 2011
I have an application using data from multiple stored procedures in a single database.The dataacess is disconnected one. Entire data is required during loadtime i.e. all calls made at load time. I want to know what is the most optimized way to do it. As the connection is required with only one database,is there a way to create it once and use it for the next times. I am aware of connection pooling but its anyways done by default. kindly suggest some way to optimize the load time. Also the result set from all the procedures cannot be clubbed so multiple stored procedure invoking is compulsory required.
View 1 Replies
Feb 17, 2011
I'm using jQuery AutoComplete Plugin in ASP.Net as outlined in the article below, so that as a user types in a .Net textbox they get a list of options to choose them. This works fine, but what I need to do now is call a server side function when the user has finished typing or has choosen a value, rather than the user having to submit the value by pressing a button.
View 2 Replies
Aug 10, 2010
I am using Ajaxtoolkit 3.5.I am using an autocomplete textbox extender.My problem is I have populated Country in the autocomplete textbox.I have to populate city in another dr
View 1 Replies
Feb 26, 2011
i have awebsite and i made all my steps to make it in the first links on the search of google (SEO) and now i want to go to google updates to make the steps that apply the website on google after one day almost. can any one tell me what i should begin with or do?
View 7 Replies
Dec 6, 2010
I have database with 40 big tables.In each stored procedure query is containing minimum 6 joins.The query is taking too much time to execute.I didn't implemented views and indexes.
View 2 Replies
Aug 17, 2010
I was wondering if anyone had experience they could share using the Response.IsClientConnected property as a performance optimization for asp.net websites.
The reason I ask is that I am a bit skeptical on how effective it would be in real life scenarios. I understand the concept of checking the value before performing a large task but I just can't see how useful this would be as clients could disconnect at any point time.
View 1 Replies
Sep 1, 2010
I have more products in a single aspx page. So I want to upload this page in my remote server where my website is running. How can I test whether search engine can resolve my product on that page?
View 1 Replies
May 30, 2013
I am using VS 2010 login form and aspnet table for user creation and role assignment. Every thing is working excellent.
My concern is that more 200 users will logon on this site simultaneously what will be the effect on performance? how to optimize site speed when more than 200 users will be log on.
View 1 Replies