AJAX and JavaScript outshine Java and Oracle in terms of search performance

My team works with a large enterprise application built in Java that interacts with an Oracle SQL database. We utilize JavaScript on the front end and are constantly seeking ways to enhance the performance of our application as its usage grows.

Currently, we are encountering an issue where a Java query is returning 39,000 records, causing a heavy load on the server and leading to browser hang. It's worth noting that the data is relatively static (updating only once a year) and we are considering using an XML map or a similar flat file approach since we know the expected results each time.

Despite our efforts, the query still takes 1.5 - 2 minutes to load, which is unacceptable. We are exploring options to optimize this scenario, including the possibility of leveraging JavaScript (or jQuery) and AJAX for a quicker database connection. We are open to suggestions on how to approach this problem more effectively.

Answer №1

To determine the cause of the slowness, consider the following factors:

  1. Check if the delay is due to the query execution in the database.
  2. Assess if the network speed is causing the delay in retrieving 39k records.
  3. Evaluate whether the javascript processing of the 39k records after the completion of ajax is contributing to the slowness.

If you can run the query in sqlplus or Toad, this will help exclude the web-tier and network from the equation. If the query is still slow, optimize it by examining indexes.

If optimizing the query does not improve performance, consider prebuilding the query results or creating a materialized view to enhance speed.

Once the query performs well in sqlplus, reintroduce the network element. Run the query from a web browser to analyze any additional overhead.

If the slowness persists, investigate whether the issue lies in the ajax data retrieval or the handling of data on the page (e.g., populating a data grid via javascript).

If the browser is waiting for data, ensure it is fetched only once by setting cache headers in the ajax request or storing results in local storage.

If handling the 39k rows in the browser is causing delays, consider alternative approaches or pagination to mitigate the issue.

Performance problems may arise from various sources, but tuning the query, optimizing indexes, or implementing pre-querying and storage solutions may resolve the issue. Additionally, consider whether fetching 39k rows at once is necessary and implement database-level pagination if possible.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using JQuery to create a checkbox with dual functionality within a function

I'm struggling to create a versatile checkbox that will toggle the display of a div from none to block when checked, and back to none when unchecked. I attempted to implement a conditional statement: $("#customCheck1").on("change", function() { if ...

What causes the Object expected error in jQuery?

Looking for a way to demo horizontal collapse pane with a simple web page that includes html, css, and jquery. <html> <head> <script type="text/javascript" src="//code.jquery.com/jquery-1.10.1.js"></script> <title>Sa ...

Developing a trivia game using HTML and JavaScript

I'm in need of some serious assistance with creating a quiz using HTML. My goal is to have a web page where users can visit, take a quiz, and have their responses stored. Unfortunately, I don't have the knowledge or skills required to do this on ...

Strategies for combining objects with varying structures on a map

SUMMARY: Looking to merge the data from Students into the corresponding values of Employees, where the value from Students should be included in the same array as Employees['avg_rate' and 'expense']. The updated object array should be ...

Guide to efficiently populating a self-referential Mongoose model

My goal is to populate data across multiple levels using the fields from an Article model: comments: [ { type: Schema.Types.ObjectId, ref: "Comment" } ] and also from ...

Altering the character by striking a key

I have a canvas with custom styling. In the center of the canvas is a single letter. Please see the code below for reference. The goal is to change the displayed letter by pressing a key on the keyboard. For instance: Letter A is centered in the canvas: P ...

Utilizing Ymacs in combination with Filepicker.io, incorporating ajax requests to fetch the desired content

I have been using Ymacs with Filepicker.io from this source and am attempting to fetch the content div through ajax calls. However, I'm facing an issue where I can't load the jQuery library as it leads to conflicts, resulting in the ajax not fun ...

Conceal hyperlink repeatedly using jQuery

I am struggling with implementing a feature where I have two links, one displayed and the other hidden. Upon clicking the first link, it should disappear and the second link should be displayed. Clicking the second link should then hide itself and show the ...

How come Vue.js is not showing the image I uploaded?

Even though I can successfully print the image URL, I'm facing an issue where the img tag is not displaying it, despite my belief that I've bound it correctly. <html> <head> <title>VueJS Split Demo</title> <script t ...

What steps can I take to decrease the padding of this footer?

Is there a way to reduce the height of the footer so it doesn't dominate the screen on both large and small devices? https://i.sstatic.net/nIQz6.png import { Container, Box, Grid } from "@material-ui/core"; const Footer = (props) => { ...

The QTP Web Extensibility Toolkit is designed to enhance your testing capabilities with AJAX

Currently, I am facing a challenge while testing a web application using QTP which utilizes ajax4jsf for its ajax functionality. Unfortunately, QTP does not have the capability to detect when the ajax processes are completed. After doing some research, I ...

Exporting modules in node.js is driving me crazy. Just four lines of code and I can't figure out what's wrong

Currently, I am delving into the realm of node.js through an online course on Udemy. However, I've run into a perplexing issue that seems to defy logic and reason. The lesson revolves around accessing external files in node.js using module.exports. I ...

Pass data from controller using Ajax in CodeIgniter

Here is my JavaScript code: $(document).ready(function(){ $("input[type='checkbox']").change(function(){ var menu_id = this.value; if(this.checked) var statusvalue = "On"; else var statusvalue = "Off"; $.ajax( ...

How can ThreeJS utilize CSS3Renderer and WebGLRenderer to display two objects in the same scene and achieve overlapping?

JSFiddle : http://jsfiddle.net/ApoG/50y32971/2/ I am working on a project where I am using CSS3Renderer to render an image as a background projected as a cube in the app. However, I also want to incorporate objects rendered using WebGLRenderer in the mid ...

Exploring the depths of AngularJS through manual injection

I seem to have misunderstood the tutorial and am struggling to get manual injection working on my project. As I'm preparing to minify and mangle my JS code, I decided to manually inject all my modules and controllers. However, I keep encountering err ...

Tips for showcasing a Bootstrap alert

I'm attempting to integrate Bootstrap Alerts into my project, but I'm struggling to display them programmatically. Here is the HTML snippet: <div class="alert alert-success alert-dismissible fade show" role="alert" id="accepted-meal-al ...

`The Art of Binding() with Objects Created on the Fly`

Currently facing challenges with rebinding something using a dynamically created object from prepend. Despite trying several methods, I am only able to unbind. Seeking assistance. $(document).ready(function(){ $(".newdir").click(function(){ $(".d-exp ...

It is impossible to remove or trim line endings with regex in Node.JS

I'm having trouble with using process and util in a NodeJS script. Even after trimming, line breaks persist in the resulting string (as seen in the console.log() output below). I'm unsure why this is happening. var util = require("util"); proces ...

Aligning validation schema with file type for synchronization

Below is the code snippet in question: type FormValues = { files: File[]; notify: string[]; }; const validationSchema = yup.object({ files: yup .array<File[]>() .of( yup .mixed<File>() .required() .t ...

The JavaScript date picker is malfunctioning in the HTML editor, but it functions properly in Fiddle

I have a working format available in a JS fiddle. Here is the code I have used on my demo site: I created a new folder named "js" and placed datepicker.js inside it, then linked it in my HTML like this: <script type="text/javascript" src="js/datepicke ...