Thursday, April 27, 2006

Trade deficit and Foreign Debt - 6

It has been a while since I wrote something about Australia's Trade Deficit and Foreign debt. In fact that last article was way back in June 2005!!

The Aus. Bureau of Stats. (ABS) released the figures for International Trade in Goods and Services February 2006 recently, and the original figures are so close to balanced, there was a minor $AUD 105Million in it.
This increase in Goods credits is still driven by the demand for ore and minerals. Australia's commodity (BBQ) economy continues the provide the fuel for growing economies. Almost all the goods were up by at least 12-15% over the last month's numbers suggesting that the numbers were adversely affected by the shorter February month.
If you review the pdf you can see the tables for the original, the deficit gets close to balance and then extends again. Civilian Aircraft makes an important impact of the debit side of the ledger, however fuel debits as up 43% over 8 months compared to last February.
No signing the K. Protocol means that Australia has not been penalised for having a comparative advantage in coal, given coal and coking coal is now by far our largest export.

The other stuff hasn't changed much as the US is still our biggest trading partner and the partner which we run the highest trade deficit with.
For all the worry and concern about China destroying our manufacturing, it is benign with the overall trend in our favour, our exports to China rose $AUD 3.6 Billion, 48% over 8 months (Feb 05 to Feb 06) whereas our imports only rose $AUD 1.9 Billion, 15% over the same period.

A quick check of the finances saw non-financial corporations borrowing heavily, this is most likely to pay for expansion to fuel the demand. An early signal that corporations feel they have expanded enough would be an continued fall in demand for imported capital goods, although the original series still shows that the continued demand for what would seem to be mining related equipment. This might also be seen in a reduction for corporate credit, although this could last longer as corporations use strong cash flows to borrow for merger and acquisition (M&A) to continue to expand.

Takeover fever really hasn't touched the booming mining industry as high prices allow companies to revisit unexplored leases both in Australia and elsewhere, rather than choosing to buy working mines to booster production whilst keeping costs at bay. M&A is happening in areas which are feeling the pinch on margins.

Mining costs will increase as lower yield ores are sourced to fill existing orders i.e. the mine life can be extended as most calculations are based on a specific price, increases in price make mining lower grade ores possible and if the company is smart it will mine those lower grade ores now at a higher cost whilst saving the lower cost, higher yielder ores for when prices drop. The aim afterall is extending the life and profit of the mine for as long as possible. This method is more longer term, ending up with more profit at the end, rather than having massive profits now at the expense of few or none later. I am sure there are companies doing both...

Have Fun

Previous articles:
Trade Deficit and Foreign Debt -1
Trade Deficit and Foreign Debt -2
Trade Deficit and Foreign Debt -3
Trade Deficit and Foreign Debt -4
Trade Deficit and Foreign Debt - 5
Related Articles:
Australian Trade Partners

Wednesday, April 26, 2006

Battlefield 2 fun #3

I made the 5000 point Staff Sergeant rank last week, I took the upgrade to the assault weapon. I have been playing around with a tool FRAPs which displays the framerate in the game and also can take movies as well. Every time I do something which would be interesting to see again it is too late unfortunately.

I have been disappointed in every upgraded weapon apart from the medic upgrade. The scope and semi-auto accuracy are very good. The rest of the weapons (apart from the sniper) seem less accurate, I still seem to shoot everything but too much in close combat even with the sights trained squarely on the enemy.

I would love EA to have kept data so that I could review my performance over time, I am definitely a better player now, but as the stats are still aggregate my earlier low scores still have too much significance of the points per minute and accuracy counters etc.

It is still great fun, even better to kill people who are clearly using some kind of dodgy aim device. I see it in every round with 5-10% of people immediately doing the dive/roll and shot on seeing you. More often then not that shot is a headshot. Are they just that good? From that distance? With that weapon? When I am moving at the same time?
As my muscle memory improves now I instinctively jump or dodge for cover (mostly in vain), sometimes I survive the first shot and kill them (much to their amazement I guess). I had one guy do the move 3 times and I still got him as I kept a building between me and his headshots.

If I feel I am getting better and the game is now almost 12 months old, does that mean the other players are also going to better rather than rookies?
Or have the best left for the next game and only the latecomers and therefore rookies are still left?

Have Fun

New Job

I have resigned from my current job (still working due 4 week notice and no replacement) and taken a role with Pythian.
The new role starts on the 22nd May 2006 and I will traveling over to Canada to catch up with Paul Vallee and the team. After that I will be back to Australia to provide coverage for the North American evening and early morning, at least in the beginning.
The role should be great, plenty of variety with the bonus of working for a DBA company (finally).

We live in a 3 bed house with a granny flat (one bedroom/bathroom detached studio) out the back. That is going to become the office for a while. It is good as now with two small children, we have reached the conclusion that we need that space for the study/office and each kid can have their own bedroom. Given we rent as Sydney house prices are bad unless you want to live 1 1/2 to 2 hours commute from the CBD, we plow the difference between rent and a massive mortgage (if we were to buy equivalent) into our own property and the added expenses of children :)

Have Fun

UNION and Venn diagrams

I had a developer come around today with a problem piece of SQL where he needed to get a distinct list of users (userids) which the application hadn't set preferences correctly for.
The joys of no constraints in the db. Here was a classic example where a constraint/rule i.e. a user must have a preference (or at least a default) in the beginning would have saved this whole data cleansing process now.
This was MySQL 4.0 so there were no subqueries (not that they were needed anyway).

We spent, well I spent about 10 minutes understanding exactly what he was trying to achieve with the SQL he provided but the overall aim of the SQL.
In the end I got out the trusty pad and drew some Venn (Set) diagrams of the JOINs and shaded the areas he wanted back. This was enough for us both to see the existing SQL was going to return the wrong result!

So where does UNION come into it?

UNION exists in almost every relational database and is used to combine to rowsets of data together. UNION will remove duplicates, UNION ALL will leave duplicates.
So instead of using a temporary table to store the rowset and issue another SQL, with UNION you can get the desired rowset in one group. This type of operation validates a performance rule i.e. visit the same data once or a few times as possible.

Example:

select userid from t1 join t2 on t1.id = t2.id
union
select userid from t3 join t4 on t3.id = t4.id

If there is a table on both sides of the UNION there is potential to replace with the appropriate join or subquery, sometimes it is easier though (unless performance is a problem) to leave it as a UNION for readability.

The end result was SQL which provided the result required, without the complexity of temporary tables. It hasn't fix the poor database design yet, as we still need to use distinct and worry about dupes.

Have Fun

Paul

Tuesday, April 25, 2006

Great article as always

The number of blogs which I use RSS to check grows over time. I use an Firefox extension called Sage to perform the aggregation and checking.

The blog: Creating Passionate Users is always a great read. This article covers the data to wisdom hierarchy with plenty of great links.

I have thought that the killer app (or at least one) is transforming data into wisdom. Given my functional programming slant plus exposure to datawarehousing and ETL (Extract Transform Load) ideas, I see this process as passing the data and then the result of each step through to a compiled form which can used to give experience, understanding and wisdom.

I kinda of see this compiled form being the input into a 3D computer environment, with the understanding and experience gained via something like a hero's journey or quest.
This allows the reuse of existing components, in the form of 3D gaming engines and Massive Multiple Player Online communities such as Everquest, World of Warcraft etc.

Whilst this is high tech, plenty of illiterate tribes have used stories and myths to pass understanding onto the next generation. So gaining understanding and wisdom through stories should be natural and easy to understand.

I keen to see what other peoples comments as, if you have links to other sites which are doing this that would be great.

Have Fun

Wednesday, April 12, 2006

Expanding Oracle knowledge

I have been using Oracle XE on Ubuntu to build the basic stock indicators. I have been using SQL to get a idea, later I am going to rewrite as functions and bundle into a package.

The main reasons for using Oracle over writing the equivalent in perl or something else is.

  1. The data now resides in a database, selecting and manipulating data is a breeze using a language I am intimate with (SQL).
  2. There is no need to reinvent the wheel or roll-your-own, after some playing with examples using the Analytical functions in Oracle is straight forward.
  3. It exposes me to new areas of Oracle and improves my skillset in Oracle. I know can take my expanded knowledge and apply that to other areas on my DBA work. I have a couple of ideas brewing along those lines.
I have come across a couple of great blogs,
  1. Oracle Data Mining and Analytics
  2. Mark Rittman
I have always enjoying learning new stuff both in database land and elsewhere. Pushing the envelope by expanding your knowledge, even within your specialty means that area remains fresh.
I have known plenty of people who have become DBAs only to move on as it was too boring or become so stale that they leave the IT area completely.

Have Fun

Paul

Saturday, April 08, 2006

Performance Tuning: Proactive tuning

Matt Rittman has a good review of a talk by Mogens on the different tuning methods and some comments about technology.

Tim Gorman had a talk about using the analytical functions LEAD/LAG to make statspack or AWR snapshots into a datawarehouse. Allowing you to track the performance of SQL across time. This allows you to identify the troublemakers that Mogens is talking about.
This link contains the whitepaper and slides from his talk to RMOUG.

Identifying and removing troublesome SQL before it becomes a problem is proactive tuning. Rather than let SQL build up and become a performance issue and then REACT, it is better to find and handle early.
This is a same for capacity planning. This task allows you to track the growth of tables, and extrapolate where they will be. Combining the growth data with performance data allows your to see what the impact of table growth is having on performance.

The scripts I have developed on SQLserver which use SQL profiler to capture SQL performance allow me to perform a similar process (although with much less metrics) and track the performance over time.

On a sidenote: Daylight savings went off without a problem after we implemented the blackout schedule for logshipping. Everything I read indicated that there wasn't a problem going backwards for the SQL Agent (next_date is the problem) however I was better to be safe then sorry.

Have Fun

Related: Automatic SQL Profiler

Wednesday, April 05, 2006

SQL Server vs Oracle: Ease of Administration

Oracle has released a study which shows that Oracle is easier to administrator as a DBA than SQL Server.
Here is a blog article about the results. I would have to agree with that blog article that any commissioned study has to very careful about bias.

My take on both databases is this, and I am in position to know as I am a DBA for both Oracle and SQLserver.
As long as nothing goes wrong SQLserver is a breeze to admin via Enterprise Manager.

However if anything goes wrong or requires some analysis, because the SQL server GUI hides the complexity, Oracle is better and easier to diagnose and tune. This is simple stuff like determining what SQL run over a period (out-of-the-box). Auditing is also easier.

The real killer continues to be the SQLserver locking method, it sucks! I hope SQL 2005 snapshots will help, but the whole readers can block writers is awful.

I have been gathering some interesting info regarding datetime datatype in SQL 2000. That is the next blog post.

Have Fun