Mysql High Performance Datatypes/Indexing

Choosing Optimal Data Types

  • Smaller is usually better.
  • Simple is good. For example, integers are cheaper to compare than characters, because character sets and collations (sorting rules) make character comparisons compli- cated.
  • Avoid NULL if possible.
VARCHAR and CHAR types
BLOB and TEXT types
Using ENUM instead of a string type
DATETIME and TIMESTAMP types
Bit-Packed Data Types

A Mixture of Normalized and Denormalized

The most common way to denormalize data is to duplicate, or cache, selected columns from one table in another table. In MySQL 5.0 and newer, you can use triggers to update the cached values, which makes the implementation easier.

Cache and Summary Tables

Materialized Views
Counter Tables

Types of Indexes

Pending...

Java Performance Os Monitoring

Bottom Up Approach

Bottom up begins at the lowest level of the software stack, at the CPU level looking at statistics such as CPU cache misses, inefficient use of CPU instructions, and then working up the software stack at what constructs or idioms are used by the application.

Choosing the Right CPU Architecture

One of the major design points behind the SPARC T-series processors is to address CPU cache misses by introducing multiple hardware threads per core.

Read More

Operating System Concepts Io System

I/O Hardware

The device communicates with the machine via a connection point, or port — for example, a serial port.

If devices use a common set of wires, the connection is called a bus. A bus is a set of wires and a rigidly defined protocol that specifies a set of messages that can be sent on the wires.

This figure shows a PCI bus (the common PC system bus) that connects the processor–memory subsystem to the fast devices and an expansion bus that connects relatively slow devices, such as the keyboard and serial and USB ports.

Read More

Operating System Concepts Virtual Memory

Demand Paging

Loading the entire program into memory results in loading the executable code for all options, regardless of whether an option is ultimately selected by the user or not. An alternative strategy is to load pages only as they are needed. This technique is known as demand paging and is commonly used in virtual memory systems.

Page Fault

A page fault causes the following sequence to occur:

Read More

Operating System Concepts Main Memory

Contiguous Memory Allocation

Problem:

Both the first-fit and best-fit strategies for memory allocation suffer from external fragmentation.

The general approach to avoiding this problem is to break the physical memory into fixed-sized blocks and allocate memory in units based on block size. With this approach, the memory allocated to a process may be slightly larger than the requested memory. The difference between these two numbers is internal fragmentation — unused memory that is internal to a partition.

Solution:

Read More

Operating System Concepts Cpu

CPU Scheduling

CPU scheduling is the task of selecting a waiting process from the ready queue and allocating the CPU to it. The CPU is allocated to the selected process by the dispatcher.

Scheduling Criteria

  • CPU utilization
  • Throughput
  • Turnaround time

The interval from the time of submission of a process to the time of completion is the turnaround time. Turnaround time is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the CPU, and doing I/O.

  • Waiting time
  • Response time

Read More

Operating System Concepts Process/Thread

Process Control Block

Process Control Block (PCB, also called Task Controlling Block, Task Struct, or Switchframe) is a data structure in the operating system kernel containing the information needed to manage a particular process.

Process state. The state may be new, ready, running, waiting, halted, and so on.

Program counter. The counter indicates the address of the next instruction to be executed for this process.

CPU registers. They include accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-code information. Along with the program counter, this state information must be saved when an interrupt occurs, to allow the process to be continued correctly afterward.

Read More

Operating System Concepts Terminology

The aim of this post is to review the crucial terms of operating-system and basic interaction of these underlying components.

Before starting with topic, I am going to reveal why I try to read books of OS related at this point. Let me conclude the reasons, first and foremost, various applications in my daily work encounter issues that are associated with LINUX system, such as buffer size, open file limits and unable to create native threads etc. All of these issues point out to the knowledge of OS. Next, Java performance tuning is always based on the operating system concept, like memory management, cpu utilization etc. Furthermore, including all the design concepts are derived from the solution of common issue inside operating system.

Due to these, it is so encouraged to read and go through operating system concept again that I could be inspired and get everything tied. If there are any findings or association with Java, I will make more explanations and comments linked with definitive resource.

Read More