performance-tuning

How many threads does it take to make them a bad choice?

I have to write a not-so-large program in C++, using boost::thread. The problem at hand, is to process a large (maybe thousands or tens of thousands. Hundreds and millons are a possibility as well) number of (possibly) large files. Each file is independent from another, and they all reside in the same directory. I´m thinking of using th...

SQL Server Index question

I have a query that joins 3 tables in SQL Server 2005, but has no Where clause, so I am indexing the fields found in the join statement. If my index is set to Col1,col2,col3 And my join is Tbl1 inner join tbl2 On Tbl1.col3=tbl2.col3 Tbl1.col2=Tbl2.col2 Tbl1.col1=Tbl2.col1 Does the order of the join statement make a difference as com...

MySQL: Avoid filesort when using IN and ORDER BY

Let's suppose I have the following table (let's call it my_table): CREATE TABLE `my_table` ( `table_id` int(10) unsigned NOT NULL auto_increment, `my_field` int(10) unsigned NOT NULL default '0' PRIMARY KEY (`table_id`), KEY `my_field` (`my_field`,`table_id`) ) ENGINE=MyISAM The primary key for my_table is table_id (auto_i...

What impact, if any, does the -d64 swtich have on Sun JVM resident memory usage?

I've got this webapp that needs some memory tuning. While I'm already profiling the application itself and trimming things down, the JVM itself seems overly bloated to me on our busiest instance. (The lower volume instances do not have this problem.) The details: Platform: RHEL4 64-bit (Linux 2.6.9-78.0.5.ELsmp #1 SMP x86_64) Sun J...

Performance issue with SQL Server stored procedure

I used the ANTS profiler to identify the remaining bottleneck in my C# application: the SQL Server stored procedure. I am using SQL Server 2008. Can anybody here help me increase performance, or give me pointers as to what I can do to make it better or more performant? First, here's the procedure: PROCEDURE [dbo].[readerSimilarity] --...

Tuning Multi-Level Rows-to-Cols Query

In the answer to a previous post (Tuning Rows-to-Cols Query), I learned how to more efficiently construct a row-to-cols query which allows for filtering by date. However, I now need to take this one level further. The schema for the query below is as follows: SAMPLE (1-to-many) TEST (1-to-many) RESULT (1-to-MANY) Each sample has one or...

Sql server tuning advisor report

I created a trace file of a days work (~10 hours) at a client and ran it in the SQL Server tuning advisor. The tuning advisor ran over the weekend and the report says: Time taken for tuning: 2 days, 13 hours, 58 minutes Number of events in workload: 1762519 Number of events tuned: 67525 Number of statements tuned: 37258 I also summe...

How to improve performance of python cgi that reads a big file and returns it as a download?

I have this python cgi script that checks if it hasn't been accessed to many times from the same IP, and if everything is ok, reads a big file form disk (11MB) and then returns it as a download. It works,but performance sucks. The bottleneck seems to be reading this huge file over and over: def download_demo(): """ Returns the...

Using filesort to sort by datetime column in MySQL

hello, I have a table Cars with datetime (DATE) and bit (PUBLIC). Now i would like to take rows ordered by DATE and with PUBLIC = 1 so i use: select c.* from Cars c WHERE c.PUBLIC = 1 ORDER BY DATE DESC But unfortunately when I use explain to see what is going on I have this: 1 SIMPLE a ALL IDX_PUBLIC,DATE NULL ...

optimizing branching by re-ordering

I have this sort of C function -- that is being called a zillion times: void foo () { if (/*condition*/) { } else if(/*another_condition*/) { } else if (/*another_condition_2*/) { } /*And so on, I have 4 of them, but we can generalize it*/ else { } } I have a good test-ca...

Obtaining more information on the cause of high figures shown in tkprof recursive totals

Friends, I am currently investigating a performance problem with our application. The problem is that an operation that should be completed almost instantly is taking several minutes. In case it is of importance the application architecture is Oracle Forms, Oracle Application Server and Oracle Database. All of which are 10.x The cus...

SQL SERVER Procedure Inconsistent Performance

I am working on a SQL Job which involves 5 procs, a few while loops and a lot of Inserts and Updates. This job processes around 75000 records. Now, the job works fine for 10000/20000 records with speed of around 500/min. After around 20000 records, execution just dies. It loads around 3000 records every 30 mins and stays at same speed...

Monitoring SQL JOB Performance Issues

I am working on a SQL Job which involves processing around 75000 records. Now, the job works fine for 10000/20000 records with speed of around 500/min. After around 20000 records, execution just dies. It loads around 3000 records every 30 mins and stays at similar speed. I asked a similar question yesterday and got few good suggestions...

How to: usage-based performance optimization in SQL Server 2008 Express

How can I do usage-based perfromance optimization if I am running SQL Server 2008 Express and using SQL Server Management Studio Express? ...

Guides for PostgreSQL query tuning?

I've found a number of resources that talk about tuning the database server, but I haven't found much on the tuning of the individual queries. For instance, in Oracle, I might try adding hints to ignore indexes or to use sort-merge vs. correlated joins, but I can't find much on tuning Postgres other than using explicit joins and recomme...

Increasing performance on a logging table in SQL Server 2005

I have a "history" table where I log each request into a Web Handler on our web site. Here is the table definition: /****** Object: Table [dbo].[HistoryRequest] Script Date: 10/09/2009 17:18:02 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[HistoryRequest]( [HistoryRequestID] [uniqueidentifier] N...

SQL Server blocking on 'create function...', what does this imply?

Hi folks, I've used the sql from this article http://blogs.techrepublic.com.com/datacenter/?p=275 to try and track down the cause of a lot of blocking which has been going on recently within my sql server 2005 database. A number of times, all the processes returned are calling 'create function...', the functions vary but a number of the...

What are the main Skills to be a Performance Consultant?

If I want to become a Performance Consultant for Java applications and systems, what are the main skills I need? long experience with Java itself using a Profiler (or StackShots) database knowledge (to avoid/detect common performance mistakes : indexes...) Caching library Java concurrency Do you agree on the importance of these? What...

Tuning FoxPro data

We tune a SQL server database by index defragmentation, or re-indexing, or dropping and rebuilding an index. Are there any such data tuning techniques for Foxpro ? Thanks, Chak. ...

High, Fluctuating '% Time in JIT' on Precompiled ASP.NET Website

With a 150 *.dll ASP.NET website that's precompiled (updatable), what are some possible causes for a '% Time in JIT' that is often quite high (> 60%) and fluctuating long after the application has warmed-up (all functionality accessed) and without app restarts or file changes that might generate new assemblies? One would expect that th...