performance

Huge performance hit when using Java/OJDBC

Hello, I am having some strange behavior with the using the Java with the "ojdbc.jar" as the client. I have a simple program that tries to just inserts 500 rows using one query. (an INSERT ALL FROM dual). This program takes 25 seconds to complete in Java. This is the time the statement.execute() method takes to complete. Wen I run ...

Tuning SSD MySql Performance

I'm testing SSDs for use with MySql and am unable to see any performance benefits. This makes me feel like I must be doing something wrong. Here is the setup: Xeon 5520 2.26 Ghz Quad Core 12 GB Ram 300GB 15k in RAID 1 64GB SSD in RAID 1 For the test I moved the mysql directory on the SSD. I imported a table with 3 million rows. T...

Ways to reduce application building/debugging time

My new office project is based on an MVP design and is in VB.NET (.NET 3.5), using multiple libraries (like EntLib, internal corporate framework, etc.). The number of DLLs used as references is so huge (almost 50) that when I try to build/debug the application in VS2008, it takes almost 3-4 minutes to get the website running successfully...

Database performance with looped update queries?

I am currently structuring my queries for a database update model with CodeIgniter. I getting the form posted input keys with $keys = array_keys($_POST) To update according database fields I was wanting to do something like this foreach($keys as $key){ $data = $this->input->post($key); $this->db->query("Update $table SET '$key...

jquery image resizing and performance

Hi, I have quite an odd problem here - I am using jquery for resizing my background image (png, width: 1793, height: 1200, size: 872kb). My function is here: bgInit = function(img, clbk) { var bgObj = $('#bgImg'); var bgHeight = bgWidth = 0; bgObj.attr('src',img).ready(function(){ var bgRatio = bgObj.height()/bgObj.width(); ...

Performance implications of .net Events

We were having a discussion at the office on how to solve a particular problem and using an event was raised (no pun intended). The response was negative citing misuse and that they can be expensive. I understand the concerns behind misuse and I know that they are just a special multicast delegate but given a scenario where there is at ...

Is there any point using MySQL "LIMIT 1" when querying on indexed/unique field?

For example, I'm querying on a field I know will be unique and is indexed such as a primary key. Hence I know this query will only return 1 row (even without the LIMIT 1) SELECT * FROM tablename WHERE tablename.id=123 LIMIT 1 or only update 1 row UPDATE tablename SET somefield='somevalue' WHERE tablename.id=123 LIMIT 1 Would adding t...

Force PostgreSQL to release allocated memory

Hi, My Postgres hits the max permitted memory under the load (500MB) and runs 14 processes. Once load is over, Postgres still keeps the allocated memory and runs 14 processes. Since I have Apache and Tomcat running on the same machine, I'd like to Postgresql release the allocated memory. Is it possible? Thanks! ...

python, sqlite3: Load existing db file to memory

Hi, I have an existing sqlite3 db file, on which I need to make some extensive calculations. Doing the calculations from the file is painfully slow, and as the file is not large (~10 MB), so there should be no problem to load it into memory. Is there a Pythonic way to load the existing file into memory in order to speed up the calculat...

On performance of Clojure's `first` function.

I saw the following example in Rich's video on sequences http://blip.tv/file/734409 about 33-36 minutes into it: (first "abcd") => \a Now, he say that this expands to (sort of): (first "abcd") => (first (seq "abcd")) => (first '(\a \b \c \d)) So, it looks like an O(N) operation because the full copy of the string is being made. Fir...

Practical Queuing Theory

I want to learn enough simple/practical queuing theory to model the behavior of a standard web application stack: Load balancer with multiple application server backends. Given a simple traffic pattern extracted from a tool like NewRelic showing percentage of traffic to a given part of an application and average response time for that...

How to profile a mysql db ?

Hi all, I'm an mssql veteran who's received a job that involves tuning a mysql db. with mssql it was simply a matter of firing up the db profiler and then crunching up the data it collects. I can't seem to find anything similar for mysql. thanks in advance ...

Most efficient way - PHP/MYSQL requests - Real time news system

Hi there, I've got a quick performance question for my real time news system. This is a community news system, where everybody can post his news, and vote for it, or vote for other news. Every 20secs in jQuery I search in the DB to refresh the 20 last news/votes. But at the moment, I extract every 20sec the last 20 questions, even if ...

UNION vs DISTINCT in performance

In SQL 2008, I have a query like so: QUERY A UNION QUERY B UNION QUERY C Will it be slower/faster than putting the result of all 3 queries in say, a temporary table and then SELECTing them with DISTINCT? ...

Why would updating a view cause a speed up?

We have a peculiar situation with a particular query. This query joins to a view which creates a PIVOT on some data. Now we are finding at some times this query runs really slow (10 seconds). I havent got a handle on how to consistently reproduce it running slowly. However, when it runs slow we can drop and recreate the View joined i...

Large portlet war takes up memory causing performance issues?

I have heard a few people say that deploying a portlet war file (or perhaps any war) that includes a lot of large jars can cause performace issues because all those jars get loaded into memory. If you have several wars, all of which include a ton of large jar files, your system will get bogged down. I'm trying to get my head around why...

SQL Joins Vs SQL Subqueries (Performance)?

Hi all, I wish to know if I have a join query something like this - Select E.Id,E.Name from Employee E join Dept D on E.DeptId=D.Id and a subquery something like this - Select E.Id,E.Name from Employee Where DeptId in (Select Id from Dept) When I consider performance which of the two queries would be faster and why ? Also is the...

Speed problems with 3 like statements in 1 query (oracle)

This is a snippet of my query: and ( ADDR_FULLTEXT like upper(:streets1) ) Whenever i execute the query this is a part of, it executes in about 0.05 seconds. This is perfect! But, when I do the following: and ( ADDR_FULLTEXT like upper(:streets1) AND ADDR_FULLTEXT like upper(:streets2) ) it results in a ...

Is this MySQL query a JOIN, a regular query or both?

I need to get data from 3 different tables. I know the basics about JOINs but when it comes to more complicated queries like getting data from 3 or more tables using JOIN I get a little confused and I just start playing with the queries writing what make sense to me, like the next one: SELECT movies.imdbID, movies.title, movies.year...

Why is code compiled with Expression<TDelegate>.Compile() slower than plain C#?

I rewrote a method that used reflection with new code that uses the System.Linq.Expressions classes and the Expression.Compile() method. As expected, the program is much faster then using reflection. I also rewrote the same method in plain C# to compare and the code in C# is 4 times faster than the code compiled with Expression.Compil...