Wednesday, July 25, 2012

Top 10+ SQL Performance Tips

Specific Query Performance Tips (see also database design tips for tips on indexes): 

  1.  Use EXPLAIN to profile the query execution plan 
  2.  Use Slow Query Log (always have it on!) 
  3.  Don't use DISTINCT when you have or could use GROUP BY
  4.  Insert performance
    1.  Batch INSERT and REPLACE
    2.  Use LOAD DATA instead of INSERT
  5.  LIMIT m,n may not be as fast as it sounds. Learn how to improve it and read more about  Efficient Pagination Using MySQL
  6.  Don't use ORDER BY RAND() if you have > ~2K records
  7.  Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data
  8.  Avoid wildcards at the start of LIKE queries
  9.  Avoid correlated subqueries and in select and where clause (try to avoid in)
  10.  No calculated comparisons -- isolate indexed columns
  11.  ORDER BY and LIMIT work best with equalities and covered indexes
  12.  Separate text/blobs from metadata, don't put text/blobs in results if you don't need them
  13.  Derived tables (subqueries in the FROM clause) can be useful for retrieving BLOBs without sorting them. (Self-join can speed up a query if 1st part finds the IDs and uses then to fetch the rest)
  14.  ALTER TABLE...ORDER BY can take data sorted chronologically and re-order it by a different field -- this can make queries on that field run faster (maybe this goes in indexing?)
  15.   Know when to split a complex query and join smaller ones
  16.   Delete small amounts at a time if you can
  17.   Make similar queries consistent so cache is used
  18.   Have good SQL query standards
  19.   Don't use deprecated features
  20.   Turning OR on multiple index fields (<5.0) into UNION may speed things up (with LIMIT), after 5.0 the index_merge should pick stuff up.
  21.   Don't use COUNT * on Innodb tables for every search, do it a few times and/or summary tables, or if you need it for the total  of rows, use SQL_CALC_FOUND_ROWS and SELECT FOUND_ROWS()
  22.   Use INSERT ... ON DUPLICATE KEY update (INSERT IGNORE) to avoid having to SELECT 
  23.   use groupwise maximum instead of subqueries
  24.   Avoid using IN(...) when selecting on indexed fields, It will kill the performance of SELECT query.
  25.  Prefer using UNION ALL if you don't need to merge the result

Scaling Performance Tips:

  1.  Use benchmarking
  2.  isolate workloads don't let administrative work interfere with customer performance. (ie backups)
  3.   Debugging sucks, testing rocks!
  4.   As your data grows, indexing may change (cardinality and selectivity change).  Structuring may want to change.  Make your schema as modular as your code.  Make your code able to scale.  Plan and embrace change, and get developers to do the same.

Network Performance Tips:

  1.  Minimize traffic by fetching only what you need.
    1.  Paging/chunked data retrieval to limit 
    2.  Don't use SELECT *
    3.  Be wary of lots of small quick queries if a longer query can be more efficient
  2.   Use multi_query if appropriate to reduce round-trips
  3.  Use stored procedures to avoid bandwidth wastage

OS Performance Tips:

  1.  Use proper data partitions
    1.  For Cluster.  Start thinking about Cluster *before* you need them
  2.  Keep the database host as clean as possible.  Do you really need a windowing system on that server?
  3.  Utilize the strengths of the OS
  4.   pare down cron scripts
  5.   create a test environment
  6.   source control schema and config files  
  7.   for LVM innodb backups, restore to a different instance of MySQL so Innodb can roll forward
  8.   partition appropriately 
  9.   partition your database when you have real data -- do not assume you know your dataset until you have real data
  10.  Reduce swappiness of your OS

MySQL Server Overall Tips:

  1.  innodb_flush_commit=0 can help slave lag
  2.  Optimize for data types, use consistent data types.  Use PROCEDURE ANALYSE() to help determine the smallest data type for your needs.
  3.  use optimistic locking, not pessimistic locking.  try to use shared lock, not exclusive lock.  share mode vs. FOR UPDATE
  4.  if you can, compress text/blobs
  5.  compress static data
  6.  don't back up static data as often
  7.  enable and increase the query and buffer caches if appropriate
  8.  config params -- http://docs.cellblue.nl/2007/03/17/easy-mysql-performance-tweaks/ is a good reference
  9.  Config variables & tips:
    1.   use one of the supplied config files
    2.   key_buffer, unix cache (leave some RAM free), per-connection variables, innodb memory variables
    3.   be aware of global vs. per-connection variables
    4.   check SHOW STATUS and SHOW VARIABLES (GLOBAL|SESSION in 5.0 and up)
    5.   be aware of swapping esp. with Linux, "swappiness" (bypass OS filecache for innodb data files, innodb_flush_method=O_DIRECT if possible (this is also OS specific))
    6.   defragment tables, rebuild indexes, do table maintenance
    7.   If you use innodb_flush_txn_commit=1, use a battery-backed hardware cache write controller
    8.   more RAM is good so faster disk speed
    9.   use 64-bit architectures
  10.   --skip-name-resolve 
  11.   increase myisam_sort_buffer_size to optimize large inserts (this is a per-connection variable)
  12.   look up memory tuning parameter for on-insert caching
  13.  increase temp table size in a data warehousing environment (default is 32Mb) so it doesn't write to disk (also constrained by max_heap_table_size, default 16Mb)
  14.   Run in SQL_MODE=STRICT to help identify warnings
  15.   /tmp dir on battery-backed write cache
  16.   consider battery-backed RAM for innodb logfiles
  17.   use --safe-updates for client
  18.   Redundant data is redundant
  19.  Keep an eye on buffer pool  and keybuffer hit rate

Storage Engine Performance Tips:

  1.  InnoDB ALWAYS keeps the primary key as part of each index, so do not make the primary key very large
  2.  Utilize different storage engines on master/slave ie, if you need fulltext indexing on a table.
  3.  BLACKHOLE engine and replication is much faster than FEDERATED tables for things like logs.
  4.  Know your storage engines and what performs best for your needs, know that different ones exist.
    1.  ie, use MERGE tables ARCHIVE tables for logs
    2.  Archive old data -- don't be a pack-rat!  2 common engines for this are ARCHIVE tables and MERGE tables
  5.  use row-level instead of table-level locking for OLTP workloads
  6.   try out a few schemas and storage engines in your test environment before picking one.

Database Design Performance Tips:

  1.  Design sane query schemas.  don't be afraid of table joins, often they are faster than denormalization
  2.  Don't use boolean flags
  3.  Use Indexes
  4.  Don't Index Everything
  5.  Do not duplicate indexes
  6.  Do not use large columns in indexes if the ratio of SELECTs:INSERTs is low.
  7.  Split out large blob elements in InnoDB
  8.  be careful of redundant columns in an index or across indexes
  9.  Use a clever key and ORDER BY instead of MAX
  10.   Normalize first, and denormalize where appropriate.  
  11.   Databases are not spreadsheets, even though Access really really looks like one.  Then again, Access isn't a real database
  12.   use INET_ATON and INET_NTOA for IP addresses, not char or varchar
  13.   make it a habit to REVERSE() email addresses, so you can easily search domains (this will help avoid wildcards at the start of LIKE queries if you want to find everyone whose e-mail is in a certain domain)
  14.   A NULL data type can take more room to store than NOT NULL
  15.  Avoid NULL in index attributes. Use 0 instead
  16.  Storing flags in a database can slow down execution due to a bad cardinality. Try using bit flags
  17.  Don't store flags in a NULL and NOT NULL manner. Update from NULL -> 1 is slower than 0 -> 1
  18.   Choose appropriate character sets & collations -- UTF16 will store each character in 2 bytes, whether it needs it or not, latin1 is faster than UTF8.
  19.   Use Triggers wisely
  20.  Use  delayed key wrote
  21.   use min_rows and max_rows to specify approximate data size so space can be pre-allocated and reference points can be calculated.  
  22.   Use HASH indexing for indexing across columns with similar data prefixes
  23.   Use myisam_pack_keys for int data
  24.   be able to change your schema without ruining functionality of your code
  25.   segregate tables/databases that benefit from different configuration variables
  26.  Don't access the last key part in a where clause with =
  27.  Abuse the system for optimiization you're using with system dependant features like RTREE's for  optimized range queries

Other:

  1.  Hire a MySQL (tm) Certified DBA
  2.  Know that there are many consulting companies out there that can help, as well as MySQL's Professional Services.
  3.  Read and post to MySQL Planet at http://planet.mysql.com
  4.  Attend the yearly MySQL Conference and Expo or other conferences with MySQL tracks (link to the conference here)
  5.  Support your local User Group (link to forge page w/user groups here)

Authored by

Jay Pipes, Sheeri Kritzer, Bill Karwin, Ronald Bradford, Farhan "Frank Mash" Mashraqi, Taso Du Val, Ron Hu, Klinton Lee, Rick James, Alan Kasindorf, Eric Bergen, Robert Eisele, Kaj Arno, Joel Seligstein, Amy Lee, Sameer Joshi, Surat Singh Bhati


Tuesday, June 5, 2012

Growth of Mobile Internet Traffic

People are increasingly using their phones to access the Internet. New information on 2012 Internet trends via KPCB shows that mobile Internet traffic has increased ten-fold in less than three years–from 1% of Internet traffic at the end of 2009 to 10% in May 2012.

Mobile internet traffic growing from 1 percent in 2009 to 10% in 2012

Monday, June 4, 2012

Hi Friends....Please Update My Mobile No:...

Hi Friends....Please Update My Mobile No: 91-9500672190.... from now on... Thanx...
View or comment on Siva Prakash's post »
Google+ makes sharing on the web more like sharing in real life. Learn more.
Join Google+
You received this message because Siva Prakash shared it with techsivam16.cloudblog@blogger.com. Unsubscribe from these emails.
You can't reply to this email. View the post to add a comment.

Thursday, April 5, 2012

Google's Project Glass

Scrapbook photo 1
Scrapbook photo 2
Scrapbook photo 3
Scrapbook photo 4
Scrapbook photo 5






 If you think texting while walking is dangerous, just wait until everyone starts wearing Google's futuristic, Internet-connected glasses.

While wearing a pair, you can see directions to your destination appear literally before your eyes. You can talk to friends over video chat, take a photo or even buy a few things online as you walk around.

These glasses can do anything you now need a smartphone or tablet computer to do -and then some.

We think technology should work for you—to be there when you need it and get out of your way when you don't. 

A group of us from Google[x] started Project Glass to build this kind of technology, one that helps you explore and share your world, putting you back in the moment. We're sharing this information now because we want to start a conversation and learn from your valuable input. So we took a few design photos to show what this technology could look like and created a video to demonstrate what it might enable you to do.

Please follow along as we share some of our ideas and stories. We'd love to hear yours, too. What would you like to see from Project Glass? 

Google said" We believe technology should work for you — to be there when you need it and get out of your way when you don't. A team within our Google[x] group started..."

Wednesday, March 14, 2012

Business Icons who Faced Utter Failure

When we talk about success, we tend to measure it with how wealthy a person is or what is the turnover of his business, but we forget to mention their business blunders which made them face failures. After all they say, "He who never made a mistake, never made a discovery". It is not a surprising fact that even successful people suffered failure in their ways of prosecuting things. But resurrecting these mistakes and trying hard have made them successful. Here are few entrepreneurs who made a splendid come back after facing utter failures.



Henry Ford



Company: Ford Motor Co.



Henry Ford is the founder of Ford Motor Company. In his early career, he started Detroit Automobile Co. in 1899, and arranged financers to back up the company. But the company dissolved within two years that is in 1901. Its produced cars were of low quality and were too posh for an average consumer.



Henry then decided to develop a new and much better automobile quality design, after this debacle. He hit the jackpot by making the Model T automobile, which is a well-made and low priced car. This revolutionized the transportation industry. Gradually his factories were able to meet the demands of Model Ts, which made it the most successful car in the history of automobile.



He says, "Whether you think you can, or you think you can't - you're right. Building a brand requires more than just building a good product".


Dame Anita Roddick



Company: The Body Shop



Dame Anita Roddick is the founder of 'The Body Shop', a well known cosmetic brand. She opened the Body Shop in Brighton, U.K., with the aim of making an income for herself, but started her business with truth rather than hype. Two of her neighboring funeral parlors objected to her brand name initially.



Anita fought back by suggesting to one of the local newspaper, that 'she was a women entrepreneur under siege'. This whole chaos fetched publicity and brought traffic to her store. Since then, she is doing very well and has more than 700 branches of 'Body Shop' stores.



Anita says, "If you think you're too small to have an impact, try going to bed with a mosquito. Don't let minor setbacks throw you off course."


Frederick W. Smith



Company: Federal Express (now FedEx Corp.)



Fredrick W. Smith is the founder of the Federal Express, which is the first overnight express delivery company in the world, whose tag line was "We live to deliver". In order to live up to his tagline, he started an electronic delivery system in 1984, called Zapmail, to compete fax machines. But this did not fetched customers well and ended with a loss of ₨17,508.84 million in 2 years.



Fredrick understood this business strategy a bit later, of acknowledging failures, avoiding bad ideas and to move on positively. He completely focused on his delivery business and successfully generated more than ₨1,750.88 billion revenue within 2010.



One of his most famous quotes is "Leaders get out in front and stay there by raising the standards by which they judge themselves and by which they are willing to be judged." He says, "(You should) be willing to acknowledge failure, abandon bad ideas and move on."


Walt Disney



Company: The Walt Disney (now Disney)



Walt Disney founded 'Walt Disney' production along with his brother. This cartoon animation company encountered several major financial setbacks in the late 1920s and 1930s, such as losing rights to the popular 'Oswald' the 'Lucky Rabbit' character. All this lead the company into a debt of ₨200.1 million by the early 1930s.



With a bare cash and finance to back the company, Disney pictures released "Snow White and the Seven Dwarfs" in 1938. It became a blockbuster film which ultimately pulled out the company from bankruptcy. Then Walt Disney eventually built the 'Walt Disney Studios' in Burbank, California.



Walt says, ""You may not realize it when it happens, but a kick in the teeth may be the best thing in the world for you. One killer idea can quickly make up for a series of flops".


Steve Jobs



Company: Apple Computer



Not to mention, Steven Paul Jobs co-founded Apple. He was forced to resign from Apple in 1985, after which he spent several years to build NeXT, a computer workstation for educators, which eventually became his comeback to Apple.



Because of NeXT's high price tag and reports of numerous bugs, its sale never materialized. Apple then announced and bought NeXT in 1996, and brought back Jobs to the company as interim CEO. This became a great turnover for the company with the success of iPod and iPad, which ultimately brought Apple in the list of most successful Fortune 500 companies of the past decade.



Steve said, "You can't just ask customers what they want and then try to give that to them. By the time you get it built, they'll want something new. Having the right resources and people around you makes a big difference".


Bill Gates



Company: Microsoft Corporation



Bill Gates along with Paul Allen started Traf-O-Data while being at high-school. Traf-O-Data was a computer business which could automatically read paper tapes from traffic counters for local governments. Regrettably, it became obsolete as the Washington state government decided to tabulate the tapes for free.



After this debacle, they got t learn how to write software for a computer. They later created Micro-Soft as a startup business, which is super successful now.



After succeeding he said, "You can learn a lot from failed endeavors. Success is a lousy teacher. It seduces smart people into thinking they can't lose."


Harland David Sanders



Company: Kentucky Fried Chicken (now KFC)



Sanders was more famous as 'Colonel Sanders'. He was more popular for his chicken fast food at Kentucky Fried Chicken, a food chain. But in 1955, he was in deep debt, which made him sell his two decade old restaurant. After settling all his debts, he was completely broke.



He had already started franchising his chicken restaurant concept by then. He started seeking franchises and within five years had 190 franchisees and 400 Kentucky Fried Chicken locations, and the rest is history.



He used to say, "Feed the poor and get rich or feed the rich and get poor. It may not be the idea that's unsuccessful; it may be the execution strategy".


Mary Kay Ash



Company: Mary Kay Cosmetics



In 1963, Ash resigned from Stanley Home Products after working for 25 years there. She did so out of frustration, as the firm overlooked her promotions. Even the men, whom she used to train, used to get through the rank. She started writing a book upon women's business plan, but soon realized, it was meant for her.



So she started her own business – Mary Kay Cosmetics. Out of rage to prove the world of a women's will power, she ended up doing the cosmetics business well. The company made₨125.06 billion profit worldwide in 2009.



Ash believes in the fact that, "For every failure, there's an alternative course of action. You just have to find it. When you come to a roadblock, take a detour. Some of the best business ideas come out of personal experience".


Dave Thomas



Company: Wendy's



He founded Wendy's, in 1982, which is a fast-food chain specializing in hamburgers. After 13 years, he retired from Wendy's which annoyed many customers as the breakfast menu unimpressed them. The firm's revenue started to go down.



Out of his semi-retirement, Thomas came into the picture and acted as the company's spokesperson in its advertisements. It worked as wonder and the company was able to stand up again.



He says, "Take care of your business and your business will take care of you". For him, "Having a strong leader at the helm can make a world of difference in the success or failure of a company".




Monday, March 12, 2012

Spring Mobile & Android

Spring Mobile is an extension to Spring MVC that aims to simplify the development of mobile web applications.


 

 


 


Spring Mobile contains extensions to Spring MVC for developing mobile web applications. This includes a module for server-side mobile device detection.

Spring for Android is an extension of the Spring Framework that aims to simplify the development of native Android applications.
Spring for Android

Thanks 


Cisco Aspire CCNA Edition Game Tutorial- from The Cisco Learning Network Store

Cisco Aspire CCNA Edition

There is no charge to download the Cisco Aspire CCNA Edition game and begin the tutorial. Unlocking additional content will require tokens.

Are you ready to be a working IT professional? Give it a try with the Cisco Aspire CCNA Edition, a game in which you navigate a virtual world where you are the IT professional.

This scenario-based game can help you prepare for the Cisco CCNA® certification exam by focusing on networking fundamentals that are based on real-world examples of IT contracts in small to medium-size organizations.

Cisco Aspire CCNA Edition is a fun and engaging way to practice networking skills and sharpen your business acumen. With topics that cover more than 80 percent of the CCNA curriculum, this game is designed to complement your instructor-led training or self-study for the Cisco CCNA certification exam.

In this game, you enter the IT workforce as a trainee. As you practice your technical skills to complete increasingly complex "contracts," you progress through the game to reach your final goal of becoming an independent IT professional. See the complete game flow and Cisco CCNA curriculum-to-game content map now.

Cisco Aspire CCNA Edition can help you gain valuable insight into your skill level as you practice your acquired knowledge of CCNA topics.

This game combines the convenience of a free preview game download direct to your PC with classic arcade-style token play.

After you have completed your preview and tutorial of Cisco Aspire CCNA Edition, you will not want to miss the challenge of completing all 19 levels.

Do you aspire to be the best in IT?

Download the Cisco Aspire CCNA Edition game now and get started with 250 game tokens at no charge. Purchase additional game tokens to continue the game and see how your networking journey ends!

Tokens Store Price (U.S. Dollars)
1000 ₨2,499.24 (complete the entire game)
500 ₨1,249.62 (complete half of the game)
250 ₨624.81 (unlock 3 contracts)
100 ₨249.92 (unlock 2 contracts)
50 ₨124.96 (unlock 1 contract)

*8 to 10 hours needed to complete the game

Minimum System Requirements

  • CPU: Intel Pentium III, 1.0 GHz or equivalent
  • OS: Microsoft Windows XP, Microsoft Windows Vista, or Microsoft Windows 7
  • RAM: 1 GB
  • Storage: 600 MB free disk space
  • Display resolution: 1024 x 768
  • Adobe Flash Player
  • Latest video card drivers and operating system updates

Recommended System:

  • CPU: Dual-core, 2.0 GHz or better
  • RAM: 1.5 GB or more
  • Storage: 600 MB free disk space
  • Sound card with speakers or headphones
  • Internet connectivity



Thanks