2007-10-05 Fri
国庆的这段时间,已经能够感觉Baby开始长大。
不肯再乖乖的躺在床上,嘴里开始学着发出各种声音,小脑袋能够跟着爸爸转,眼睛里满是好奇的纯真。
我的天使在成长。
我的天使在成长
慢慢的微笑 轻轻的舞蹈
我的天使在成长
今天在怀抱 明天也许就能奔跑
我的天使...在成长...
相关文章|Related Articles
评论数量(0)|Add Comments
本文网址:http://www.eygle.com/archives/2007/10/baby_bigger.html


When I was comparing performance of UNION vs MySQL 5.0 index merge algorithm Sinisa pointed out I should be using UNION ALL instead of simple UNION in my benchmarks, and he was right. Numbers would be different but it should not change general point of having optimization of moving LIMIT inside of union clause being cool thing.
But So is UNION ALL indeed faster than UNION DISTINCT (the UNION is shortcut for UNION DISTINCT) ?
Indeed it is. I did not have the same data as I used for the other test but I created similar test case - table with separate indexes on "a" and "b" columns with cardinality of 100, having about 40.000.000 of rows
-
SELECT * FROM test.abc WHERE i=5 union SELECT * FROM test.abc WHERE j=5
This original query was taking about 22 seconds.
As I modified it:
-
SELECT * FROM test.abc WHERE i=5 union ALL SELECT * FROM test.abc WHERE j=5 AND i!=5
The query time dropped to about 6 seconds which is 3.5 times faster - quite considerable improvement.
As you can notice I added "i!=5" clause - this is what allows us to ensure we do not have duplicate rows in result set matching both conditions and so result will be same as query with "i=5 or j=5" where clause.
I also tried this original query (which uses index merge method in MySQL 5.0):
-
SELECT * FROM test.abc WHERE i=5 OR j=5
Such query takes 4 seconds so if you do not need to trick with order by and limit using index merge is faster than UNION as it indeed should be.
So why UNION ALL is faster than UNION DISTINCT ?
The first informed guess would be - because UNION ALL does not need to use temporary table to store result set, however this is not correct - both UNION ALL and UNION distinct use temporary table for result generation. Perhaps one more thing for Optimizer Team to look into.
Interesting enough the fact UNION and UNION ALL require temporary table can only be seen in SHOW STATUS - EXPLAIN does not want to tell you this shameful fact:
-
mysql> EXPLAIN (SELECT * FROM test.abc WHERE i=5) union ALL (SELECT * FROM test.abc WHERE j=5 AND i!=5) \G
-
*************************** 1. row ***************************
-
id: 1
-
select_type: PRIMARY
-
TABLE: abc
-
type: ref
-
possible_keys: i
-
KEY: i
-
key_len: 5
-
ref: const
-
rows: 348570
-
Extra: USING WHERE
-
*************************** 2. row ***************************
-
id: 2
-
select_type: UNION
-
TABLE: abc
-
type: ref
-
possible_keys: i,j
-
KEY: j
-
key_len: 5
-
ref: const
-
rows: 349169
-
Extra: USING WHERE
-
*************************** 3. row ***************************
-
id: NULL
-
select_type: UNION RESULT
-
TABLE: <union1,2>
-
type: ALL
-
possible_keys: NULL
-
KEY: NULL
-
key_len: NULL
-
ref: NULL
-
rows: NULL
-
Extra:
-
3 rows IN SET (0.00 sec)
In fact EXPLAIN output is the same for UNION and UNION ALL (which is too bad as execution for them is obviously different).
The difference in execution speed comes from the fact UNION requires internal temporary table with index (to skip duplicate rows) while UNION ALL will create table without such index.
This also explains why difference becomes larger when on disk table is required (as in this case) - Hash indexes used by MEMORY table are very efficient and do not give so much overhead.
Entry posted by peter | No comment
About one month ago we posted a call for interns to work with us on various MySQL Performance related things.
We got good number of replies and a lot of people wondered what tasks exactly we could offer as surely this sort of involvement should be fun and should teach you something.
Really we did not have a list - Cool opportunities and
ideas constantly pop up plus we expect you to bring your ideas on what
you would be interested to work on and we will see if there is an
interest for us to mentor and sponsor your work.
Generally the tasks we see Interns working on are either Open Source
projects or research which would be published so besides minor
financial compensation there is publicity and education components.
Here are few things we have in mind:
- MySQL Benchmarks we have a lot of things we wanted to take a look but never found a time. These are hardware, operation systems, file systems, mysql storage engines, settings, MySQL versions, etc
- MySQL Patches - there are a lot of little cool things you can do to improve performance monitoring in MySQL
- Innodb Performance Experiments - There are a lot of hard coded values which Heikki picked on his laptop 10 years ago, not all of them are still optimal now. We'd like to see if we can pick better values for some workloads.
- Web Application Database Benchmark - we would like to get few benchmarks
which present typical web LAMP application workloads - Full Text Search Benchmark - we would like to get
comparison for MySQL build in full text search, Sphinx, Lucene, PostgreSQL Searches.
Entry posted by peter | No comment
Will democratizing sustainable housing be enough to change Canada? It’s too early to tell, but there’s a start. Open source can make sustainable designs available. Nobody owns it, everybody can use it, and anybody can improve it. The Now House is one sustainable housing design project created by one small team. What would happen if one hundred teams created projects like this?
Toronto-based firm Work Worth Doing created Now House™, a project whose mission is to turn a 60-year-old WWII house into a near zero energy home—one that produces as much energy as it uses. The idea for this one house, coupled with the benefits of open source, has the potential to affect millions of homes and demonstrate how open source thinking can be applied to one of the biggest problems facing the world today. Canada shoulders its own share of this burden and is currently way off-track from meeting its Kyoto Protocol goals.
Over the next ten years, how could open source thinking continue to play a role in the Now House project?
The process for retrofitting one house to become a near zero energy home, will serve as the basis for future phases of the project.
The homes within a wartime housing community are similar in structure, making the national rollout of the Now House model possible. There are an estimated one million wartime homes across Canada (see figure 1). As the project gains momentum, the scale will necessitate the participation of many different players located throughout the nation. Creating an open source platform allows multiple partners–builders, governments and homeowners–to contribute input and provide resources.
Sources for the data in figure 2:
- About 12 million occupied homes in 2004. Source: “Population and dwelling counts, for Canada provinces and territories, 2006 and 2001 censuses — 100% data,” Statistics Canada.
- 57% are single detached homes, equaling 6.84 million homes. Source: “Improving Energy Performance in Canada” page 17, Figure 3-1.
- GHG emission reduction per year in tons: The residential sector produces 77 mega tons of GHG emissions. Source: “Improving Energy Performance in Canada” page 17.
- 57% of the residential sector (single detached homes) produces 43.89 mega tons of GHG emissions. 43.89 mega tons of GHG emissions x 60% estimated Now House GHG reduction for detached housing.
In the hypothetical rollout to all existing houses, the retrofitting teams could apply their wartime housing knowledge to other single-detached homes (see figure 2). By creating a platform for participation, there’s an opportunity for a community of collaborators to build on past work because of open source knowledge. Could this knowledge empower Now House participants to create a sustainable, profitable marketplace while positively changing Canada’s GHG emissions?
Canadians may want to spend more time saving the environment given their current ecological footprint, which would require four planet Earths to sustain if everyone on the planet lived like them. It takes 7.6 global hectares of resources to support each Canadian according to the latest World Wildlife Fund’s Living Planet Report (see figure 3). An open source platform for sustainable housing could pull groups from all over Canada and provide them with vibrant connections and resources through which they can share ideas, best practices and make a living through creating near zero energy homes. The Now House team thinks that small changes can equal big results. Small changes and collaboration on a national scale through an open source platform is one way to do just that.
-
A handy cheat sheet that you can print and hang over your desk.
-
Useful presentations from the SouthEastern Oracle Users Conference.
-
This is the official XML DB FAQ thread on forums.oracle.com.
-
Provides basic information about connecting to Oracle, installation, and creating Oracle Database XE + RoR applications.
-
Free extracts of SQL University.net courses covering a variety of topics.
More from my bookmarks on del.icio.us
---
Related Articles at Eddie Awad's Blog:
- 10 Useful Links You Should Check Out Today (2007-09-07)
- 5 Useful Links You Should Check Out Today (2007-09-28)
- 40+ Links for Knowing the New Oracle Database 11g
- Oracle OpenWorld 2007
- LOBs Gotcha in ColdFusion
2007-10-04 Thu
On September 15, more than 330 teams around the world held Software Freedom Day events as part of a global, grassroots effort to educate the public about the importance of software freedom and the virtues and availability of Free and Open Source Software (FOSS).
This short video includes highlights from the SFD event held in Chapel Hill, NC, including Max Spevack’s Fedora talk and Mark Finkle from Mozilla.
Watch the video, then visit softwarefreedomday.org to learn more. Keep an eye on their web site and join their mailing lists to get involved with a 2008 Software Freedom Day event.
EMC Corporation announced the acquisition of Utah-based startup Mozy this morning, confirming our story of September 23. The price is not being disclosed, but our sources indicate that Mozy was acquired for $76 million.
This was an excellent liquidity event for the Mozy team, which had raised just $1.9 million back in 2005. The company claims 300,000 business and consumer customers for their online backup storage solution.
Crunch Network: CrunchGear drool over the sexiest new gadgets and hardware.
2007-10-03 Wed
AnySQL.net
DBA notes
Oracle & Starcraft
eagle's home
给你点color see see
AnySQL.net English
Oracle Scratchpad
Oracle Life
OracleDBA Blog
Photos from dbanotes
Chanel [K]
Oracle Security Blog
ERN空间
Eddie Awad's Blog
MySQL Performance Blog
The Tom Kyte Blog
del.icio.us/fenng/oracle
AIXpert
O'Reilly Databases
Red Hat Magazine
DBASupport
DB2 Magazine 中文版
developerWorks : AIX 专区的文章,教程
Pythian Group Blog » Log Buffer
车东[Blog^2]
blue_prince
玉面飞龙的BLOG
此生 今世
人生就是如此
Orange Tiger 木匠 的 移民生活
生活帮-LifeBang
Hey!! Sky!
dba on unix
Oracle Notes Wiki
Welcome to brotherxiao's Home
柔嘉维则@life.oracle.eng
Fenng's shared items in Google Reader
jametong's shared items in Google Reader
Tanel Poder's blog: Core IT for geeks and pros
DBA Tools
DBA is thinking
NinGoo@Net







