text:
Optimization is a complex task because ultimately it requires understanding of the entire system to be optimized. Although it may be possible to perform some local optimizations with little knowledge of your system or application, the more optimal you want your system to become, the more you will have to know about it.
This chapter tries to explain and give some examples of different ways to optimize MySQL. Remember, however, that there are always additional ways to make the system even faster, although they may require increasing effort to achieve.
6.1 Optimization Overview
The most important factor in making a system fast is its basic design. You also need to know what kinds of things your system will be doing, and what your bottlenecks are.
The most common system bottlenecks are:
Disk seeks. It takes time for the disk to find a piece of data. With modern disks, the mean time for this is usually lower than 10ms, so we can in theory do about 100 seeks a second. This time improves slowly with new disks and is very hard to optimize for a single table. The way to optimize seek time is to distribute the data onto more than one disk.
Disk reading and writing. When the disk is at the correct position, we need to read the data. With modern disks, one disk delivers at least 10-20MB/s throughput. This is easier to optimize than seeks because you can read in parallel from multiple disks.
CPU cycles. When we have the data in main memory (or if it was already there), we need to process it to get our result. Having small tables compared to the amount of memory is the most common limiting factor. But with small tables, speed is usually not the problem.
Memory bandwidth. When the CPU needs more data than can fit in the CPU cache, main memory bandwidth becomes a bottleneck. This is an uncommon bottleneck for most systems, but one to be aware of.
6.1.1 MySQL Design Limitations and Tradeoffs
When using the MyISAM storage engine, MySQL uses extremely fast table locking that allows multiple readers or a single writer. The biggest problem with this storage engine occurs when you have a steady stream of mixed updates and slow selects on a single table. If this is a problem for certain tables, you can use another table type for them. See Chapter 8, "MySQL Storage Engines and Table Types."
MySQL can work with both transactional and non-transactional tables. To be able to work smoothly with non-transactional tables (which can't roll back if something goes wrong), MySQL has the following rules:
All columns have default values.
If you insert a "wrong" value in a column, such as a too-large numerical value into a numerical column, MySQL sets the column to the "best possible value" instead of giving an error. For numerical values, this is 0, the smallest possible value, or the largest possible value. For strings, this is either the empty string or the longest possible string that can be stored in the column.
All calculated expressions return a value that can be used instead of signaling an error condition. For example, 1/0 returns NULL.
The implication of these rules is that you should not use MySQL to check column content. Instead, you should check values within your application before storing them in the database.
6.1.2 Designing Applications for Portability
Because all SQL servers implement different parts of standard SQL, it takes work to write portable SQL applications. It is very easy to achieve portability for very simple selects and inserts, but becomes more difficult the more capabilities you require. If you want an application that is fast with many database systems, it becomes even harder!
To make a complex application portable, you need to determine which SQL servers it must work with, then determine what features those servers support.
All database systems have some weak points. That is, they have different design compromises that lead to different behavior.
You can use the MySQL crash-me program to find functions, types, and limits that you can use with a selection of database servers. crash-me does not check for every possible feature, but it is still reasonably comprehensive, performing about 450 tests.
An example of the type of information crash-me can provide is that you shouldn't have column names longer than 18 characters if you want to be able to use Informix or DB2.
The crash-me program and the MySQL benchmarks are all very database independent. By taking a look at how they are written, you can get a feeling for what you have to do to make your own applications database independent. The programs can be found in the sql-bench directory of MySQL source distributions. They are written in Perl and use the DBI database interface. Use of DBI in itself solves part of the portability problem because it provides database-independent access methods.
For crash-me results, visit http://dev.mysql.com/tech-resources/crash-me.php. See http://dev.mysql.com/tech-resources/benchmarks/ for the results from the benchmarks.
If you strive for database independence, you need to get a good feeling for each SQL server's bottlenecks. For example, MySQL is very fast in retrieving and updating records for MyISAM tables, but will have a problem in mixing slow readers and writers on the same table. Oracle, on the other hand, has a big problem when you try to access rows that you have recently updated (until they are flushed to disk). Transactional databases in general are not very good at generating summary tables from log tables, because in this case row locking is almost useless.
To make your application really database independent, you need to define an easily extendable interface through which you manipulate your data. Because C++ is available on most systems, it makes sense to use a C++ class-based interface to the databases.
If you use some feature that is specific to a given database system (such as the REPLACE statement, which is specific to MySQL), you should implement the same feature for other SQL servers by coding an alternative method. Although the alternative may be slower, it will allow the other servers to perform the same tasks.
With MySQL, you can use the /*! */ syntax to add MySQL-specific keywords to a query. The code inside /**/ will be treated as a comment (and ignored) by most other SQL servers.
If high performance is more important than exactness, as in some Web applications, it is possible to create an application layer that caches all results to give you even higher performance. By letting old results "expire" after a while, you can keep the cache reasonably fresh. This provides a method to handle high load spikes, in which case you can dynamically increase the cache and set the expiration timeout higher until things get back to normal.
In this case, the table creation information should contain information of the initial size of the cache and how often the table should normally be refreshed.
An alternative to implementing an application cache is to use the MySQL query cache. By enabling the query cache, the server handles the details of determining whether a query result can be reused. This simplifies your application. See Section 4.10, "The MySQL Query Cache."
6.1.3 What We Have Used MySQL For
This section describes an early application for MySQL.
During MySQL initial development, the features of MySQL were made to fit our largest customer, which handled data warehousing for a couple of the largest retailers in Sweden.
From all stores, we got weekly summaries of all bonus card transactions, and were expected to provide useful information for the store owners to help them find how their advertising campaigns were affecting their own customers.
The volume of data was quite huge (about seven million summary transactions per month), and we had data for 4-10 years that we needed to present to the users. We got weekly requests from our customers, who wanted to get "instant" access to new reports from this data.
We solved this problem by storing all information per month in compressed "transaction" tables. We had a set of simple macros that generated summary tables grouped by different criteria (product group, customer id, store, and so on) from the tables in which the transactions were stored. The reports were Web pages that were dynamically generated by a small Perl script. This script parsed a Web page, executed the SQL statements in it, and inserted the results. We would have used PHP or mod_perl instead, but they were not available at the time.
For graphical data, we wrote a simple tool in C that could process SQL query results and produce GIF images based on those results. This tool also was dynamically executed from the Perl script that parsed the Web pages.
In most cases, a new report could be created simply by copying an existing script and modifying the SQL query in it. In some cases, we needed to add more columns to an existing summary table or generate a new one, but this also was quite simple because we kept all transaction-storage tables on disk. (This amounted to about 50GB of transaction tables and 200GB of other customer data.)
We also let our customers access the summary tables directly with ODBC so that the advanced users could experiment with the data themselves.
This system worked well and we had no problems handling the data with quite modest Sun Ultra SPARCstation hardware (2x200MHz). Eventually the system was migrated to Linux.
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.1.4 The MySQL Benchmark Suite}
This section should contain a technical description of the MySQL benchmark suite (and crash-me), but that description has not yet been written. Currently, you can get a good idea of the benchmarks by looking at the code and results in the sql-bench directory in any MySQL source distribution.
This benchmark suite is meant to tell any user what operations a given SQL implementation performs well or poorly.
Note that this benchmark is single-threaded, so it measures the minimum time for the operations performed. We plan to add multi-threaded tests to the benchmark suite in the future.
To use the benchmark suite, the following requirements must be satisfied:
The benchmark suite is provided with MySQL source distributions. You can either download a released distribution from http://dev.mysql.com/downloads/, or use the current development source tree (see Section 2.3.3, "Installing from the Development Source Tree").
The benchmark scripts are written in Perl and use the Perl DBI module to access database servers, so DBI must be installed. You will also need the server-specific DBD drivers for each of the servers you want to test. For example, to test MySQL, PostgreSQL, and DB2, you must have the DBD::mysql, DBD::Pg, and DBD::DB2 modules installed. See Section 2.7, "Perl Installation Notes."
After you obtain a MySQL source distribution, you will find the benchmark suite in its sql-bench directory. To run the benchmark tests, build MySQL, then change location into the sql-bench directory and execute the run-all-tests script:
shell> cd sql-bench shell> perl run-all-tests –server=server_name
server_name is one of the supported servers. To get a list of all options and supported servers, invoke this command:
shell> perl run-all-tests –help
The crash-me script also is located in the sql-bench directory. crash-me tries to determine what features a database supports and what its capabilities and limitations are by actually running queries. For example, it determines:
What column types are supported
How many indexes are supported
What functions are supported
How big a query can be
How big a VARCHAR column can be
You can find the results from crash-me for many different database servers at http://dev.mysql.com/tech-resources/crash-me.php. For more information about benchmark results, visit http://dev.mysql.com/tech-resources/benchmarks/.
6.1.5 Using Your Own Benchmarks
You should definitely benchmark your application and database to find out where the bottlenecks are. By fixing a bottleneck (or by replacing it with a "dummy module"), you can then easily identify the next bottleneck. Even if the overall performance for your application currently is acceptable, you should at least make a plan for each bottleneck, and decide how to solve it if someday you really need the extra performance.
For an example of portable benchmark programs, look at the MySQL benchmark suite. See Section 6.1.4, "The MySQL Benchmark Suite." You can take any program from this suite and modify it for your needs. By doing this, you can try different solutions to your problem and test which really is fastest for you.
Another free benchmark suite is the Open Source Database Benchmark, available at http://osdb.sourceforge.net/.
It is very common for a problem to occur only when the system is very heavily loaded. We have had many customers who contact us when they have a (tested) system in production and have encountered load problems. In most cases, performance problems turn out to be due to issues of basic database design (for example, table scans are not good at high load) or problems with the operating system or libraries. Most of the time, these problems would be a lot easier to fix if the systems were not already in production.
To avoid problems like this, you should put some effort into benchmarking your whole application under the worst possible load! You can use Super Smack for this. It is available at http://jeremy.zawodny.com/mysql/super-smack/. As the name suggests, it can bring a system to its knees if you ask it, so make sure to use it only on your development systems.
6.2 Optimizing SELECT Statements and Other Queries
First, one factor affects all statements: The more complex your permission setup is, the more overhead you will have.
Using simpler permissions when you issue GRANT statements enables MySQL to reduce permission-checking overhead when clients execute statements. For example, if you don't grant any table-level or column-level privileges, the server need not ever check the contents of the tables_priv and columns_priv tables. Similarly, if you place no resource limits on any accounts, the server does not have to perform resource counting. If you have a very high query volume, it may be worth the time to use a simplified grant structure to reduce permission-checking overhead.
If your problem is with some specific MySQL expression or function, you can use the BENCHMARK() function from the mysql client program to perform a timing test. Its syntax is BENCHMARK(loop_count,expression). For example:
mysql> SELECT BENCHMARK(1000000,1+1); +————————+ | BENCHMARK(1000000,1+1) | +————————+ | 0 | +————————+ 1 row in set (0.32 sec)
This result was obtained on a Pentium II 400MHz system. It shows that MySQL can execute 1,000,000 simple addition expressions in 0.32 seconds on that system.
All MySQL functions should be very optimized, but there may be some exceptions. BENCHMARK() is a great tool to find out if this is a problem with your query.
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.2.1 EXPLAIN Syntax (Get Information About a SELECT)}
EXPLAIN Syntax (Get Information About a SELECT)
EXPLAIN tbl_name
EXPLAIN SELECT select_options
The EXPLAIN statement can be used either as a synonym for DESCRIBE or as a way to obtain information about how MySQL will execute a SELECT statement:
The EXPLAIN tbl_name syntax is synonymous with DESCRIBE tbl_name or SHOW COLUMNS FROM tbl_name.
When you precede a SELECT statement with the keyword EXPLAIN, MySQL explains how it would process the SELECT, providing information about how tables are joined and in which order.
This section provides information about the second use of EXPLAIN.
With the help of EXPLAIN, you can see when you must add indexes to tables to get a faster SELECT that uses indexes to find records.
You should frequently run ANALYZE TABLE to update table statistics such as cardinality of keys, which can affect the choices the optimizer makes.
You can also see whether the optimizer joins the tables in an optimal order. To force the optimizer to use a join order corresponding to the order in which the tables are named in the SELECT statement, begin the statement with SELECT STRAIGHT_JOIN rather than just SELECT.
EXPLAIN returns a row of information for each table used in the SELECT statement. The tables are listed in the output in the order that MySQL would read them while processing the query. MySQL resolves all joins using a single-sweep multi-join method. This means that MySQL reads a row from the first table, then finds a matching row in the second table, then in the third table, and so on. When all tables are processed, it outputs the selected columns and backtracks through the table list until a table is found for which there are more matching rows. The next row is read from this table and the process continues with the next table.
In MySQL version 4.1, the EXPLAIN output format was changed to work better with constructs such as UNION statements, subqueries, and derived tables. Most notable is the addition of two new columns: id and select_type. You will not see these columns when using servers older than MySQL 4.1.
Each output row from EXPLAIN provides information about one table, and each row consists of the following columns:
The SELECT identifier. This is the sequential number of the SELECT within the query.
The type of SELECT, which can be any of the following:
Simple SELECT (not using UNION or subqueries)
Outermost SELECT
Second or later SELECT statement in a UNION
Second or later SELECT statement in a UNION, dependent on outer subquery
First SELECT in subquery
First SELECT in subquery, dependent on outer subquery
Derived table SELECT (subquery in FROM clause)
The table to which the row of output refers.
The join type. The different join types are listed here, ordered from the best type to the worst:
The table has only one row (= system table). This is a special case of the const join type.
The table has at most one matching row, which will be read at the start of the query. Because there is only one row, values from the column in this row can be regarded as constants by the rest of the optimizer. const tables are very fast because they are read only once!
const is used when you compare all parts of a PRIMARY KEY or UNIQUE index with constant values. In the following queries, tbl_name can be used as a const table:
SELECT * FROM tbl_name WHERE primary_key=1; SELECT * FROM tbl_name WHERE primary_key_part1=1 AND primary_key_part2=2;
One row will be read from this table for each combination of rows from the previous tables. Other than the const types, this is the best possible join type. It is used when all parts of an index are used by the join and the index is a PRIMARY KEY or UNIQUE index.
eq_ref can be used for indexed columns that are compared using the = operator. The comparison value can be a constant or an expression that uses columns from tables that are read before this table.
In the following examples, MySQL can use an eq_ref join to process ref_table:
SELECT * FROM ref_table,other_table WHERE ref_table.key_column=other_table.column; SELECT * FROM ref_table,other_table WHERE ref_table.key_column_part1=other_table.column AND ref_table.key_column_part2=1;
All rows with matching index values will be read from this table for each combination of rows from the previous tables. ref is used if the join uses only a leftmost prefix of the key or if the key is not a PRIMARY KEY or UNIQUE index (in other words, if the join cannot select a single row based on the key value). If the key that is used matches only a few rows, this is a good join type.
ref can be used for indexed columns that are compared using the = operator.
In the following examples, MySQL can use a ref join to process ref_table:
SELECT * FROM ref_table WHERE key_column=expr; SELECT * FROM ref_table,other_table WHERE ref_table.key_column=other_table.column; SELECT * FROM ref_table,other_table WHERE ref_table.key_column_part1=other_table.column AND ref_table.key_column_part2=1;
This join type is like ref, but with the addition that MySQL will do an extra search for rows that contain NULL values. This join type optimization is new for MySQL 4.1.1 and is mostly used when resolving subqueries.
In the following examples, MySQL can use a ref_or_null join to process ref_table:
SELECT * FROM ref_table WHERE key_column=expr OR key_column IS NULL;
See Section 6.2.6, "How MySQL Optimizes IS NULL."
This join type indicates that the Index Merge optimization is used. In this case, the key column contains a list of indexes used, and key_len contains a list of the longest key parts for the indexes used. For more information, see Section 6.2.5, "How MySQL Optimizes OR Clauses."
This type replaces ref for some IN subqueries of the following form:
value IN (SELECT primary_key FROM single_table WHERE some_expr)
unique_subquery is just an index lookup function that replaces the subquery completely for better efficiency.
This join type is similar to unique_subquery. It replaces IN subqueries, but it works for non-unique indexes in subqueries of the following form:
value IN (SELECT key_column FROM single_table WHERE some_expr)
Only rows that are in a given range will be retrieved, using an index to select the rows. The key column indicates which index is used. The key_len contains the longest key part that was used. The ref column will be NULL for this type.
range can be used for when a key column is compared to a constant using any of the =, <>, >, >=, <, <=, IS NULL, <=>, BETWEEN, or IN operators:
SELECT * FROM tbl_name WHERE key_column = 10; SELECT * FROM tbl_name WHERE key_column BETWEEN 10 and 20; SELECT * FROM tbl_name WHERE key_column IN (10,20,30); SELECT * FROM tbl_name WHERE key_part1= 10 AND key_part2 IN (10,20,30);
This join type is the same as ALL, except that only the index tree is scanned. This usually is faster than ALL, because the index file usually is smaller than the data file.
MySQL can use this join type when the query uses only columns that are part of a single index.
A full table scan will be done for each combination of rows from the previous tables. This is normally not good if the table is the first table not marked const, and usually very bad in all other cases. Normally, you can avoid ALL by adding indexes that allow row retrieval from the table based on constant values or column values from earlier tables.
The possible_keys column indicates which indexes MySQL could use to find the rows in this table. Note that this column is totally independent of the order of the tables as displayed in the output from EXPLAIN. That means that some of the keys in possible_keys might not be usable in practice with the generated table order.
If this column is NULL, there are no relevant indexes. In this case, you may be able to improve the performance of your query by examining the WHERE clause to see whether it refers to some column or columns that would be suitable for indexing. If so, create an appropriate index and check the query with EXPLAIN again.
To see what indexes a table has, use SHOW INDEX FROM tbl_name.
The key column indicates the key (index) that MySQL actually decided to use. The key is NULL if no index was chosen. To force MySQL to use or ignore an index listed in the possible_keys column, use FORCE INDEX, USE INDEX, or IGNORE INDEX in your query.
For MyISAM and BDB tables, running ANALYZE TABLE will help the optimizer choose better indexes. For MyISAM tables, myisamchk –analyze will do the same. See Section 4.6.2, "Table Maintenance and Crash Recovery."
The key_len column indicates the length of the key that MySQL decided to use. The length is NULL if the key column says NULL. Note that the value of key_len allows you to determine how many parts of a multiple-part key MySQL will actually use.
The ref column shows which columns or constants are used with the key to select rows from the table.
The rows column indicates the number of rows MySQL believes it must examine to execute the query.
This column contains additional information about how MySQL will resolve the query. Here is an explanation of the different text strings that can appear in this column:
MySQL will stop searching for more rows for the current row combination after it has found the first matching row.
Not exists
MySQL was able to do a LEFT JOIN optimization on the query and will not examine more rows in this table for the previous row combination after it finds one row that matches the LEFT JOIN criteria.
Here is an example of the type of query that can be optimized this way:
SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;
Assume that t2.id is defined as NOT NULL. In this case, MySQL will scan t1 and look up the rows in t2 using the values of t1.id. If MySQL finds a matching row in t2, it knows that t2.id can never be NULL, and will not scan through the rest of the rows in t2 that have the same id value. In other words, for each row in t1, MySQL needs to do only a single lookup in t2, regardless of how many rows actually match in t2.
range checked for each record (index map: #)
MySQL found no good index to use. Instead, for each row combination in the preceding tables, it will do a check to determine which index to use (if any), and use it to retrieve the rows from the table. This is not very fast, but is faster than performing a join with no index at all.
Using filesort
MySQL will need to do an extra pass to find out how to retrieve the rows in sorted order. The sort is done by going through all rows according to the join type and storing the sort key and pointer to the row for all rows that match the WHERE clause. The keys then are sorted and the rows are retrieved in sorted order.
Using index
The column information is retrieved from the table using only information in the index tree without having to do an additional seek to read the actual row. This strategy can be used when the query uses only columns that are part of a single index.
Using temporary
To resolve the query, MySQL will need to create a temporary table to hold the result. This typically happens if the query contains GROUP BY and ORDER BY clauses that list columns differently.
Using where
A WHERE clause will be used to restrict which rows to match against the next table or send to the client. Unless you specifically intend to fetch or examine all rows from the table, you may have something wrong in your query if the Extra value is not Using where and the table join type is ALL or index.
If you want to make your queries as fast as possible, you should look out for Extra values of Using filesort and Using temporary.
You can get a good indication of how good a join is by taking the product of the values in the rows column of the EXPLAIN output. This should tell you roughly how many rows MySQL must examine to execute the query. If you restrict queries with the max_join_size system variable, this product also is used to determine which multiple-table SELECT statements to execute. See Section 6.5.2, "Tuning Server Parameters."
The following example shows how a multiple-table join can be optimized progressively based on the information provided by EXPLAIN.
Suppose that you have the SELECT statement shown here and you plan to examine it using EXPLAIN:
EXPLAIN SELECT tt.TicketNumber, tt.TimeIn, tt.ProjectReference, tt.EstimatedShipDate, tt.ActualShipDate, tt.ClientID, tt.ServiceCodes, tt.RepetitiveID, tt.CurrentProcess, tt.CurrentDPPerson, tt.RecordVolume, tt.DPPrinted, et.COUNTRY, et_1.COUNTRY, do.CUSTNAME FROM tt, et, et AS et_1, do WHERE tt.SubmitTime IS NULL AND tt.ActualPC = et.EMPLOYID AND tt.AssignedPC = et_1.EMPLOYID AND tt.ClientID = do.CUSTNMBR;
For this example, make the following assumptions:
The columns being compared have been declared as follows:
Column Type
The tables have the following indexes:
EMPLOYID (primary key)
CUSTNMBR (primary key)
The tt.ActualPC values are not evenly distributed.
Initially, before any optimizations have been performed, the EXPLAIN statement produces the following information:
table type possible_keys key key_len ref rows Extra et ALL PRIMARY NULL NULL NULL 74 do ALL PRIMARY NULL NULL NULL 2135 et_1 ALL PRIMARY NULL NULL NULL 74 tt ALL AssignedPC, NULL NULL NULL 3872 ClientID, ActualPC range checked for each record (key map: 35)
Because type is ALL for each table, this output indicates that MySQL is generating a Cartesian product of all the tables; that is, every combination of rows. This will take quite a long time, because the product of the number of rows in each table must be examined. For the case at hand, this product is 74 * 2135 * 74 * 3872 = 45,268,558,720 rows. If the tables were bigger, you can only imagine how long it would take.
One problem here is that MySQL can use indexes on columns more efficiently if they are declared the same. (For ISAM tables, indexes may not be used at all unless the columns are declared the same.) In this context, VARCHAR and CHAR are the same unless they are declared as different lengths. Because tt.ActualPC is declared as CHAR(10) and et.EMPLOYID is declared as CHAR(15), there is a length mismatch.
To fix this disparity between column lengths, use ALTER TABLE to lengthen ActualPC from 10 characters to 15 characters:
mysql> ALTER TABLE tt MODIFY ActualPC VARCHAR(15);
Now tt.ActualPC and et.EMPLOYID are both VARCHAR(15). Executing the EXPLAIN statement again produces this result:
table type possible_keys key key_len ref rows Extra tt ALL AssignedPC, NULL NULL NULL 3872 Using ClientID, where ActualPC do ALL PRIMARY NULL NULL NULL 2135 range checked for each record (key map: 1) et_1 ALL PRIMARY NULL NULL NULL 74 range checked for each record (key map: 1) et eq_ref PRIMARY PRIMARY 15 tt.ActualPC 1
This is not perfect, but is much better: The product of the rows values is now less by a factor of 74. This version is executed in a couple of seconds.
A second alteration can be made to eliminate the column length mismatches for the tt.AssignedPC = et_1.EMPLOYID and tt.ClientID = do.CUSTNMBR comparisons:
mysql> ALTER TABLE tt MODIFY AssignedPC VARCHAR(15), -> MODIFY ClientID VARCHAR(15);
Now EXPLAIN produces the output shown here:
table type possible_keys key key_len ref rows Extra et ALL PRIMARY NULL NULL NULL 74 tt ref AssignedPC, ActualPC 15 et.EMPLOYID 52 Using ClientID, where ActualPC et_1 eq_ref PRIMARY PRIMARY 15 tt.AssignedPC 1 do eq_ref PRIMARY PRIMARY 15 tt.ClientID 1
This is almost as good as it can get.
The remaining problem is that, by default, MySQL assumes that values in the tt.ActualPC column are evenly distributed, and that is not the case for the tt table. Fortunately, it is easy to tell MySQL to analyze the key distribution:
mysql> ANALYZE TABLE tt;
Now the join is perfect, and EXPLAIN produces this result:
table type possible_keys key key_len ref rows Extra tt ALL AssignedPC NULL NULL NULL 3872 Using ClientID, where ActualPC et eq_ref PRIMARY PRIMARY 15 tt.ActualPC 1 et_1 eq_ref PRIMARY PRIMARY 15 tt.AssignedPC 1 do eq_ref PRIMARY PRIMARY 15 tt.ClientID 1
Note that the rows column in the output from EXPLAIN is an educated guess from the MySQL join optimizer. You should check whether the numbers are even close to the truth. If not, you may get better performance by using STRAIGHT_JOIN in your SELECT statement and trying to list the tables in a different order in the FROM clause.
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.2.2 Estimating Query Performance}
In most cases, you can estimate the performance by counting disk seeks. For
small tables, you can usually find a row in one disk seek (because the index is
probably cached). For bigger tables, you can estimate that, using B-tree
indexes, you will need this many seeks to find a row:
log(row_count) / log(index_block_length / 3 * 2 / (index_length + data_pointer_length)) + 1.
In MySQL, an index block is usually 1024 bytes and the data pointer is usually 4 bytes. For a 500,000-row table with an index length of 3 bytes (medium integer), the formula indicates log(500,000)/log(1024/3*2/(3+4)) + 1 = 4 seeks.
This index would require storage of about 500,000 * 7 * 3/2 = 5.2MB (assuming a typical index buffer fill ratio of 2/3), so you will probably have much of the index in memory and you will probably need only one or two calls to read data to find the row.
For writes, however, you will need four seek requests (as above) to find where to place the new index and normally two seeks to update the index and write the row.
Note that the preceding discussion doesn't mean that your application performance will slowly degenerate by log N! As long as everything is cached by the OS or SQL server, things will become only marginally slower as the table gets bigger. After the data gets too big to be cached, things will start to go much slower until your application is only bound by disk-seeks (which increase by log N). To avoid this, increase the key cache size as the data grows. For MyISAM tables, the key cache size is controlled by the key_buffer_size system variable. See Section 6.5.2, "Tuning Server Parameters."
6.2.3 Speed of SELECT Queries
In general, when you want to make a slow SELECT … WHERE query faster, the first thing to check is whether you can add an index. All references between different tables should usually be done with indexes. You can use the EXPLAIN statement to determine which indexes are used for a SELECT. See Section 6.4.5, "How MySQL Uses Indexes," and Section 6.2.1, "EXPLAIN Syntax (Get Information About a SELECT)."
Some general tips for speeding up queries on MyISAM tables:
To help MySQL optimize queries better, use ANALYZE TABLE or run myisamchk –analyze on a table after it has been loaded with data. This updates a value for each index part that indicates the average number of rows that have the same value. (For unique indexes, this is always 1.) MySQL will use this to decide which index to choose when you join two tables based on a non-constant expression. You can check the result from the table analysis by using SHOW INDEX FROM tbl_name and examining the Cardinality value. myisamchk –description –verbose shows index distribution information.
To sort an index and data according to an index, use myisamchk –sort-index –sort-records=1 (if you want to sort on index 1). This is a good way to make queries faster if you have a unique index from which you want to read all records in order according to the index. Note that the first time you sort a large table this way, it may take a long time.
6.2.4 How MySQL Optimizes WHERE Clauses
This section discusses optimizations that can be made for processing WHERE clauses. The examples use SELECT statements, but the same optimizations apply for WHERE clauses in DELETE and UPDATE statements.
Note that work on the MySQL optimizer is ongoing, so this section is incomplete. MySQL does many optimizations, not all of which are documented here.
Some of the optimizations performed by MySQL are listed here:
- Removal of unnecessary parentheses:
((a AND b) AND c OR (((a AND b) AND (c AND d)))) -> (a AND b AND c) OR (a AND b AND c AND d)
- Constant folding:
(a<b AND b=c) AND a=5 -> b>5 AND b=c AND a=5
- Constant condition removal (needed because of constant folding):
Constant expressions used by indexes are evaluated only once.
COUNT(*) on a single table without a WHERE is retrieved directly from the table information for MyISAM and HEAP tables. This is also done for any NOT NULL expression when used with only one table.
Early detection of invalid constant expressions. MySQL quickly detects that some SELECT statements are impossible and returns no rows.
HAVING is merged with WHERE if you don't use GROUP BY or group functions (COUNT(), MIN(), and so on).
For each table in a join, a simpler WHERE is constructed to get a fast WHERE evaluation for the table and also to skip records as soon as possible.
All constant tables are read first before any other tables in the query. A constant table is any of the following:
An empty table or a table with one row.
A table that is used with a WHERE clause on a PRIMARY KEY or a UNIQUE index, where all index parts are compared to constant expressions and are defined as NOT NULL.
- All of the following tables are used as constant tables:
SELECT * FROM t WHERE primary_key=1; SELECT * FROM t1,t2 WHERE t1.primary_key=1 AND t2.primary_key=t1.id;
The best join combination for joining the tables is found by trying all possibilities. If all columns in ORDER BY and GROUP BY clauses come from the same table, that table is preferred first when joining.
If there is an ORDER BY clause and a different GROUP BY clause, or if the ORDER BY or GROUP BY contains columns from tables other than the first table in the join queue, a temporary table is created.
If you use SQL_SMALL_RESULT, MySQL uses an in-memory temporary table.
Each table index is queried, and the best index is used unless the optimizer believes that it will be more efficient to use a table scan. At one time, a scan was used based on whether the best index spanned more than 30% of the table. Now the optimizer is more complex and bases its estimate on additional factors such as table size, number of rows, and I/O block size, so a fixed percentage no longer determines the choice between using an index or a scan.
In some cases, MySQL can read rows from the index without even consulting the data file. If all columns used from the index are numeric, only the index tree is used to resolve the query.
Before each record is output, those that do not match the HAVING clause are skipped.
Some examples of queries that are very fast:
SELECT COUNT(*) FROM tbl_name; SELECT MIN(key_part1),MAX(key_part1) FROM tbl_name; SELECT MAX(key_part2) FROM tbl_name WHERE key_part1=constant; SELECT … FROM tbl_name ORDER BY key_part1,key_part2,… LIMIT 10; SELECT … FROM tbl_name ORDER BY key_part1 DESC, key_part2 DESC, … LIMIT 10;
The following queries are resolved using only the index tree, assuming that the indexed columns are numeric:
SELECT key_part1,key_part2 FROM tbl_name WHERE key_part1=val; SELECT COUNT(*) FROM tbl_name WHERE key_part1=val1 AND key_part2=val2; SELECT key_part2 FROM tbl_name GROUP BY key_part1;
The following queries use indexing to retrieve the rows in sorted order without a separate sorting pass:
SELECT … FROM tbl_name ORDER BY key_part1,key_part2,… ; SELECT … FROM tbl_name ORDER BY key_part1 DESC, key_part2 DESC, … ;
6.2.5 How MySQL Optimizes OR Clauses
The Index Merge method is used to retrieve rows with several ref, ref_or_null, or range scans and merge the results into one. This method is employed when the table condition is a disjunction of conditions for which ref, ref_or_null, or range could be used with different keys.
This "join" type optimization is new in MySQL 5.0.0, and represents a significant change in behavior with regard to indexes, because the old rule was that the server is only ever able to use at most one index for each referenced table.
In EXPLAIN output, this method appears as index_merge in the type column. In this case, the key column contains a list of indexes used, and key_len contains a list of the longest key parts for those indexes.
SELECT * FROM tbl_name WHERE key_part1 = 10 OR key_part2 = 20; SELECT * FROM tbl_name WHERE (key_part1 = 10 OR key_part2 = 20) AND non_key_part=30; SELECT * FROM t1,t2 WHERE (t1.key1 IN (1,2) OR t1.key2 LIKE 'value%') AND t2.key1=t1.some_col; SELECT * FROM t1,t2 WHERE t1.key1=1 AND (t2.key1=t1.some_col OR t2.key2=t1.some_col2);
|This article is excerpted from MySQL Administrator's Guide,by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.2.6 How MySQL Optimizes IS NULL}
MySQL can do the same optimization on col_name IS NULL that it can do with col_name = constant_value. For example, MySQL can use indexes and ranges to search for NULL with IS NULL.
SELECT * FROM tbl_name WHERE key_col IS NULL; SELECT * FROM tbl_name WHERE key_col <=> NULL; SELECT * FROM tbl_name WHERE key_col=const1 OR key_col=const2 OR key_col IS NULL;
If a WHERE clause includes a col_name IS NULL condition for a column that is declared as NOT NULL, that expression will be optimized away. This optimization does not occur in cases when the column might produce NULL anyway; for example, if it comes from a table on the right side of a LEFT JOIN.
MySQL 4.1.1 and up can additionally optimize the combination col_name = expr AND col_name IS NULL, a form that is common in resolved subqueries. EXPLAIN will show ref_or_null when this optimization is used.
This optimization can handle one IS NULL for any key part.
Some examples of queries that are optimized, assuming that there is an index on columns a and b or table t2:
SELECT * FROM t1 WHERE t1.a=expr OR t1.a IS NULL; SELECT * FROM t1,t2 WHERE t1.a=t2.a OR t2.a IS NULL; SELECT * FROM t1,t2 WHERE (t1.a=t2.a OR t2.a IS NULL) AND t2.b=t1.b; SELECT * FROM t1,t2 WHERE t1.a=t2.a AND (t2.b=t1.b OR t2.b IS NULL); SELECT * FROM t1,t2 WHERE (t1.a=t2.a AND t2.a IS NULL AND …) OR (t1.a=t2.a AND t2.a IS NULL AND …);
ref_or_null works by first doing a read on the reference key, and then a separate search for rows with a NULL key value.
Note that the optimization can handle only one IS NULL level. In the following query, MySQL will use key lookups only on the expression (t1.a=t2.a AND t2.a IS NULL) and not be able to use the key part on b:
SELECT * FROM t1,t2 WHERE (t1.a=t2.a AND t2.a IS NULL) OR (t1.b=t2.b AND t2.b IS NULL) ;
6.2.7 How MySQL Optimizes DISTINCT
DISTINCT combined with ORDER BY will need a temporary table in many cases.
Note that because DISTINCT may use GROUP BY, you should be aware of how MySQL works with columns in ORDER BY or HAVING clauses that are not part of the selected columns.
MySQL extends the use of GROUP BY so that you can use columns or calculations in the SELECT list that don't appear in the GROUP BY clause. This stands for any possible value for this group. You can use this to get better performance by avoiding sorting and grouping on unnecessary items. For example, you don't need to group on customer.name in the following query:
mysql> SELECT order.custid, customer.name, MAX(payments) -> FROM order,customer -> WHERE order.custid = customer.custid -> GROUP BY order.custid;
In standard SQL, you would have to add customer.name to the GROUP BY clause. In MySQL, the name is redundant if you don't run in ANSI mode.
Do not use this feature if the columns you omit from the GROUP BY part are not unique in the group! You will get unpredictable results.
In some cases, you can use MIN() and MAX() to obtain a specific column value even if it isn't unique. The following gives the value of column from the row containing the smallest value in the sort column:
SUBSTR(MIN(CONCAT(RPAD(sort,6,' '),column)),7)
When combining LIMIT row_count with DISTINCT, MySQL stops as soon as it finds row_count unique rows.
If you don't use columns from all tables named in a query, MySQL stops scanning the not-used tables as soon as it finds the first match. In the following case, assuming that t1 is used before t2 (which you can check with EXPLAIN), MySQL stops reading from t2 (for any particular row in t1) when the first row in t2 is found:
SELECT DISTINCT t1.a FROM t1,t2 where t1.a=t2.a;
6.2.8 How MySQL Optimizes LEFT JOIN and RIGHT JOIN
A LEFT JOIN B join_condition is implemented in MySQL as follows:
Table B is set to depend on table A and all tables on which A depends.
Table A is set to depend on all tables (except B) that are used in the LEFT JOIN condition.
The LEFT JOIN condition is used to decide how to retrieve rows from table B. (In other words, any condition in the WHERE clause is not used.)
All standard join optimizations are done, with the exception that a table is always read after all tables on which it depends. If there is a circular dependence, MySQL issues an error.
All standard WHERE optimizations are done.
If there is a row in A that matches the WHERE clause, but there is no row in B that matches the ON condition, an extra B row is generated with all columns set to NULL.
If you use LEFT JOIN to find rows that don't exist in some table and you have the following test: col_name IS NULL in the WHERE part, where col_name is a column that is declared as NOT NULL, MySQL stops searching for more rows (for a particular key combination) after it has found one row that matches the LEFT JOIN condition.
RIGHT JOIN is implemented analogously to LEFT JOIN, with the roles of the tables reversed.
The join optimizer calculates the order in which tables should be joined. The table read order forced by LEFT JOIN and STRAIGHT_JOIN helps the join optimizer do its work much more quickly, because there are fewer table permutations to check. Note that this means that if you do a query of the following type, MySQL will do a full scan on b because the LEFT JOIN forces it to be read before d:
SELECT * FROM a,b LEFT JOIN c ON (c.key=a.key) LEFT JOIN d ON (d.key=a.key) WHERE b.key=d.key;
The fix in this case is to rewrite the query as follows:
SELECT * FROM b,a LEFT JOIN c ON (c.key=a.key) LEFT JOIN d ON (d.key=a.key) WHERE b.key=d.key;
Starting from 4.0.14, MySQL does the following LEFT JOIN optimization: If the WHERE condition is always false for the generated NULL row, the LEFT JOIN is changed to a normal join.
For example, the WHERE clause would be false in the following query if t2.column1 would be NULL:
SELECT * FROM t1 LEFT JOIN t2 ON (column1) WHERE t2.column2=5;
Therefore, it's safe to convert the query to a normal join:
SELECT * FROM t1,t2 WHERE t2.column2=5 AND t1.column1=t2.column1;
This can be made faster because MySQL can now use table t2 before table t1 if this would result in a better query plan. To force a specific table order, use STRAIGHT_JOIN.
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.2.9 How MySQL Optimizes ORDER BY}
In some cases, MySQL can use an index to satisfy an ORDER BY or GROUP BY clause without doing any extra sorting.
The index can also be used even if the ORDER BY doesn't match the index exactly, as long as all the unused index parts and all the extra ORDER BY columns are constants in the WHERE clause. The following queries will use the index to resolve the ORDER BY or GROUP BY part:
SELECT * FROM t1 ORDER BY key_part1,key_part2,… ; SELECT * FROM t1 WHERE key_part1=constant ORDER BY key_part2; SELECT * FROM t1 WHERE key_part1=constant GROUP BY key_part2; SELECT * FROM t1 ORDER BY key_part1 DESC, key_part2 DESC; SELECT * FROM t1 WHERE key_part1=1 ORDER BY key_part1 DESC, key_part2 DESC;
In some cases, MySQL cannot use indexes to resolve the ORDER BY, although it still will use indexes to find the rows that match the WHERE clause. These cases include the following:
You use ORDER BY on different keys:
SELECT * FROM t1 ORDER BY key1, key2;
You use ORDER BY on non-consecutive key parts:
SELECT * FROM t1 WHERE key_part2=constant ORDER BY key_part2;
You mix ASC and DESC:
SELECT * FROM t1 ORDER BY key_part1 DESC, key_part2 ASC;
The key used to fetch the rows is not the same as the one used in the ORDER BY:
SELECT * FROM t1 WHERE key2=constant ORDER BY key1;
You are joining many tables, and the columns in the ORDER BY are not all from the first non-constant table that is used to retrieve rows. (This is the first table in the EXPLAIN output that doesn't have a const join type.)
You have different ORDER BY and GROUP BY expressions.
The type of table index used doesn't store rows in order. For example, this is true for a HASH index in a HEAP table.
In those cases where MySQL must sort the result, it uses the following algorithm:
Read all rows according to key or by table scanning. Rows that don't match the WHERE clause are skipped.
Store the sort key value in a buffer. The size of the buffer is the value of the sort_buffer_size system variable.
When the buffer gets full, run a qsort (quicksort) on it and store the result in a temporary file. Save a pointer to the sorted block. (If all rows fit into the sort buffer, no temporary file is created.)
Repeat the preceding steps until all rows have been read.
Do a multi-merge of up to MERGEBUFF (7) regions to one block in another temporary file. Repeat until all blocks from the first file are in the second file.
Repeat the following until there are fewer than MERGEBUFF2 (15) blocks left.
On the last multi-merge, only the pointer to the row (the last part of the sort key) is written to a result file.
Read the rows in sorted order by using the row pointers in the result file. To optimize this, we read in a big block of row pointers, sort them, and use them to read the rows in sorted order into a row buffer. The size of the buffer is the value of the read_rnd_buffer_size system variable. The code for this step is in the sql/records.cc source file.
With EXPLAIN SELECT … ORDER BY, you can check whether MySQL can use indexes to resolve the query. It cannot if you see Using filesort in the Extra column. See Section 6.2.1, "EXPLAIN Syntax (Get Information About a SELECT)."
If you want to increase ORDER BY speed, first see whether you can get MySQL to use indexes rather than an extra sorting phase. If this is not possible, you can try the following strategies:
Increase the size of the sort_buffer_size variable.
Increase the size of the read_rnd_buffer_size variable.
Change tmpdir to point to a dedicated filesystem with lots of empty space. If you use MySQL 4.1 or later, this option accepts several paths that are used in round-robin fashion. Paths should be separated by colon characters (':') on Unix and semicolon characters (';') on Windows, NetWare, and OS/2. You can use this feature to spread the load across several directories. Note: The paths should be for directories in filesystems that are located on different physical disks, not different partitions of the same disk.
By default, MySQL sorts all GROUP BY col1, col2, … queries as if you specified ORDER BY col1, col2, … in the query as well. If you include an ORDER BY clause explicitly that contains the same column list, MySQL optimizes it away without any speed penalty, although the sorting still occurs. If a query includes GROUP BY but you want to avoid the overhead of sorting the result, you can suppress sorting by specifying ORDER BY NULL. For example:
INSERT INTO foo SELECT a, COUNT(*) FROM bar GROUP BY a ORDER BY NULL;
6.2.10 How MySQL Optimizes LIMIT
In some cases, MySQL will handle a query differently when you are using LIMIT row_count and not using HAVING:
If you are selecting only a few rows with LIMIT, MySQL uses indexes in some cases when normally it would prefer to do a full table scan.
If you use LIMIT row_count with ORDER BY, MySQL ends the sorting as soon as it has found the first row_count lines rather than sorting the whole table.
When combining LIMIT row_count with DISTINCT, MySQL stops as soon as it finds row_count unique rows.
In some cases, a GROUP BY can be resolved by reading the key in order (or doing a sort on the key) and then calculating summaries until the key value changes. In this case, LIMIT row_count will not calculate any unnecessary GROUP BY values.
As soon as MySQL has sent the required number of rows to the client, it aborts the query unless you are using SQL_CALC_FOUND_ROWS.
LIMIT 0 always quickly returns an empty set. This is useful to check the query or to get the column types of the result columns.
When the server uses temporary tables to resolve the query, the LIMIT row_count is used to calculate how much space is required.
6.2.11 How to Avoid Table Scans
The output from EXPLAIN will show ALL in the type column when MySQL uses a table scan to resolve a query. This usually happens under the following conditions:
The table is so small that it's faster to do a table scan than a key lookup. This is a common case for tables with fewer than 10 rows and a short row length.
There are no usable restrictions in the ON or WHERE clause for indexed columns.
You are comparing indexed columns with constant values and MySQL has calculated (based on the index tree) that the constants cover too large a part of the table and that a table scan would be faster. See Section 6.2.4, "How MySQL Optimizes WHERE Clauses."
You are using a key with low cardinality (many rows match the key value) through another column. In this case, MySQL assumes that by using the key it will probably do a lot of key lookups and that a table scan would be faster.
For small tables, a table scan often is appropriate. For large tables, try the following techniques to avoid having the optimizer incorrectly choose a table scan:
Use ANALYZE TABLE tbl_name to update the key distributions for the scanned table.
Use FORCE INDEX for the scanned table to tell MySQL that table scans are very expensive compared to using the given index.
SELECT * FROM t1, t2 FORCE INDEX (index_for_column) WHERE t1.col_name=t2.col_name;
Start mysqld with the –max-seeks-for-key=1000 option or use SET max_seeks_for_key=1000 to tell the optimizer to assume that no key scan will cause more than 1,000 key seeks. See Section 4.2.3, "Server System Variables."
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.2.12 Speed of INSERT Queries}
The time to insert a record is determined by the following factors, where the numbers indicate approximate proportions:
Connecting: (3)
Sending query to server: (2)
Parsing query: (2)
Inserting record: (1 x size of record)
Inserting indexes: (1 x number of indexes)
Closing: (1)
This does not take into consideration the initial overhead to open tables, which is done once for each concurrently running query.
The size of the table slows down the insertion of indexes by log N, assuming B-tree indexes.
You can use the following methods to speed up inserts:
If you are inserting many rows from the same client at the same time, use INSERT statements with multiple VALUES lists to insert several rows at a time. This is much faster (many times faster in some cases) than using separate single-row INSERT statements. If you are adding data to a non-empty table, you may tune the bulk_insert_buffer_size variable to make it even faster. See Section 4.2.3, "Server System Variables."
If you are inserting a lot of rows from different clients, you can get higher speed by using the INSERT DELAYED statement.
With MyISAM tables you can insert rows at the same time that SELECT statements are running if there are no deleted rows in the tables.
When loading a table from a text file, use LOAD DATA INFILE. This is usually 20 times faster than using a lot of INSERT statements.
With some extra work, it is possible to make LOAD DATA INFILE run even faster when the table has many indexes. Use the following procedure:
Optionally create the table with CREATE TABLE.
Execute a FLUSH TABLES statement or a mysqladmin flush-tables command.
Use myisamchk –keys-used=0 -rq /path/to/db/tbl_name. This will remove all use of all indexes for the table.
Insert data into the table with LOAD DATA INFILE. This will not update any indexes and will therefore be very fast.
If you are going to only read the table in the future, use myisampack to make it smaller. See Section 184.108.40.206, "Compressed Table Characteristics."
Re-create the indexes with myisamchk -r -q /path/to/db/tbl_name. This will create the index tree in memory before writing it to disk, which is much faster because it avoids lots of disk seeks. The resulting index tree is also perfectly balanced.
Execute a FLUSH TABLES statement or a mysqladmin flush-tables command.
Note that LOAD DATA INFILE also performs the preceding optimization if you insert into an empty MyISAM table; the main difference is that you can let myisamchk allocate much more temporary memory for the index creation than you might want the server to allocate for index re-creation when it executes the LOAD DATA INFILE statement.
As of MySQL 4.0, you can also use ALTER TABLE tbl_name DISABLE KEYS instead of myisamchk –keys-used=0 -rq /path/to/db/tbl_name and ALTER TABLE tbl_name ENABLE KEYS instead of myisamchk -r -q /path/to/db/tbl_name. This way you can also skip the FLUSH TABLES steps.
- You can speed up INSERT operations that are done with multiple
statements by locking your tables:
LOCK TABLES a WRITE; INSERT INTO a VALUES (1,23),(2,34),(4,33); INSERT INTO a VALUES (8,26),(6,29); UNLOCK TABLES;
A performance benefit occurs because the index buffer is flushed to disk only once after all INSERT statements have completed. Normally there would be as many index buffer flushes as there are different INSERT statements. Explicit locking statements are not needed if you can insert all rows with a single statement.
For transactional tables, you should use BEGIN/COMMIT instead of LOCK TABLES to get a speedup.
- Locking also lowers the total time of multiple-connection tests, although
the maximum wait time for individual connections might go up because they wait
for locks. For example:
Connection 1 does 1000 inserts Connections 2, 3, and 4 do 1 insert Connection 5 does 1000 inserts
If you don't use locking, connections 2, 3, and 4 will finish before 1 and 5. If you use locking, connections 2, 3, and 4 probably will not finish before 1 or 5, but the total time should be about 40% faster.
INSERT, UPDATE, and DELETE operations are very fast in MySQL, but you will obtain better overall performance by adding locks around everything that does more than about five inserts or updates in a row. If you do very many inserts in a row, you could do a LOCK TABLES followed by an UNLOCK TABLES once in a while (about each 1,000 rows) to allow other threads access to the table. This would still result in a nice performance gain.
INSERT is still much slower for loading data than LOAD DATA INFILE, even when using the strategies just outlined.
To get some more speed for MyISAM tables, for both LOAD DATA INFILE and INSERT, enlarge the key cache by increasing the key_buffer_size system variable. See Section 6.5.2, "Tuning Server Parameters."
6.2.13 Speed of UPDATE Queries
Update queries are optimized as a SELECT query with the additional overhead of a write. The speed of the write depends on the amount of data being updated and the number of indexes that are updated. Indexes that are not changed will not be updated.
Also, another way to get fast updates is to delay updates and then do many updates in a row later. Doing many updates in a row is much quicker than doing one at a time if you lock the table.
Note that for a MyISAM table that uses dynamic record format, updating a record to a longer total length may split the record. If you do this often, it is very important to use OPTIMIZE TABLE occasionally.
6.2.14 Speed of DELETE Queries
The time to delete individual records is exactly proportional to the number of indexes. To delete records more quickly, you can increase the size of the key cache. See Section 6.5.2, "Tuning Server Parameters."
If you want to delete all rows in the table, use TRUNCATE TABLE tbl_name rather than DELETE FROM tbl_name.
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.
{mospagebreak title=6.2.15 Other Optimization Tips}
This section lists a number of miscellaneous tips for improving query processing speed:
Use persistent connections to the database to avoid connection overhead. If you can't use persistent connections and you are initiating many new connections to the database, you may want to change the value of the thread_cache_size variable. See Section 6.5.2, "Tuning Server Parameters."
Always check whether all your queries really use the indexes you have created in the tables. In MySQL, you can do this with the EXPLAIN statement. See Section 6.2.1, "EXPLAIN Syntax (Get Information About a SELECT)."
Try to avoid complex SELECT queries on MyISAM tables that are updated frequently, to avoid problems with table locking that occur due to contention between readers and writers.
With MyISAM tables that have no deleted rows, you can insert rows at the end at the same time that another query is reading from the table. If this is important for you, you should consider using the table in ways that avoid deleting rows. Another possibility is to run OPTIMIZE TABLE after you have deleted a lot of rows.
Use ALTER TABLE … ORDER BY expr1, expr2, … if you mostly retrieve rows in expr1, expr2, … order. By using this option after extensive changes to the table, you may be able to get higher performance.
- In some cases, it may make sense to introduce a column that is "hashed"
based on information from other columns. If this column is short and reasonably
unique, it may be much faster than a big index on many columns. In MySQL, it's
very easy to use this extra column:
SELECT * FROM tbl_name WHERE hash_col=MD5(CONCAT(col1,col2)) AND col1='constant' AND col2='constant';
For MyISAM tables that change a lot, you should try to avoid all variable-length columns (VARCHAR, BLOB, and TEXT). The table will use dynamic record format if it includes even a single variable-length column. See Chapter 8, "MySQL Storage Engines and Table Types."
It's normally not useful to split a table into different tables just because the rows get "big." To access a row, the biggest performance hit is the disk seek to find the first byte of the row. After finding the data, most modern disks can read the whole row fast enough for most applications. The only cases where it really matters to split up a table is if it's a MyISAM table with dynamic record format (see above) that you can change to a fixed record size, or if you very often need to scan the table but do not need most of the columns. See Chapter 8, "MySQL Storage Engines and Table Types."
- If you very often need to calculate results such as counts based on
information from a lot of rows, it's probably much better to introduce a new
table and update the counter in real time. An update of the following form is
very fast:
UPDATE tbl_name SET count_col=count_col+1 WHERE key_col=constant;
This is really important when you use MySQL storage engines such as MyISAM and ISAM that have only table-level locking (multiple readers / single writers). This will also give better performance with most databases, because the row locking manager in this case will have less to do.
If you need to collect statistics from large log tables, use summary tables instead of scanning the entire log table. Maintaining the summaries should be much faster than trying to calculate statistics "live." It's much faster to regenerate new summary tables from the logs when things change (depending on business decisions) than to have to change the running application!
If possible, you should classify reports as "live" or "statistical," where data needed for statistical reports is created only from summary tables that are generated periodically from the live data.
Take advantage of the fact that columns have default values. Insert values explicitly only when the value to be inserted differs from the default. This reduces the parsing that MySQL needs to do and improves the insert speed.
In some cases, it's convenient to pack and store data into a BLOB column. In this case, you must add some extra code in your application to pack and unpack information in the BLOB values, but this may save a lot of accesses at some stage. This is practical when you have data that doesn't conform to a rows-and-columns table structure.
Normally, you should try to keep all data non-redundant (what is called "third normal form" in database theory). However, do not be afraid to duplicate information or create summary tables if necessary to gain more speed.
Stored procedures or UDFs (user-defined functions) may be a good way to get more performance for some tasks. However, if you use a database system that does not support these capabilities, you should always have another way to perform the same tasks, even if the alternative method is slower.
You can always gain something by caching queries or answers in your application and then performing many inserts or updates together. If your database supports table locks (like MySQL and Oracle), this should help to ensure that the index cache is only flushed once after all updates.
Use INSERT DELAYED when you do not need to know when your data is written. This speeds things up because many records can be written with a single disk write.
Use INSERT LOW_PRIORITY when you want to give SELECT statements higher priority than your inserts.
Use SELECT HIGH_PRIORITY to get retrievals that jump the queue. That is, the SELECT is done even if there is another client waiting to do a write.
Use multiple-row INSERT statements to store many rows with one SQL statement (many SQL servers support this).
Use LOAD DATA INFILE to load large amounts of data. This is faster than using INSERT statements.
Use AUTO_INCREMENT columns to generate unique values.
Use OPTIMIZE TABLE once in a while to avoid fragmentation with MyISAM tables when using a dynamic table format. See Section 8.1.3, "MyISAM Table Storage Formats."
Use HEAP tables when possible to get more speed. See Chapter 8, "MySQL Storage Engines and Table Types."
When using a normal Web server setup, images should be stored as files. That is, store only a file reference in the database. The main reason for this is that a normal Web server is much better at caching files than database contents, so it's much easier to get a fast system if you are using files.
Use in-memory tables for non-critical data that is accessed often, such as information about the last displayed banner for users who don't have cookies enabled in their Web browser.
Columns with identical information in different tables should be declared to have identical data types. Before MySQL 3.23, you get slow joins otherwise.
Try to keep column names simple. For example, in a table named customer, use a column name of name instead of customer_name. To make your names portable to other SQL servers, you should keep them shorter than 18 characters.
If you need really high speed, you should take a look at the low-level interfaces for data storage that the different SQL servers support! For example, by accessing the MySQL MyISAM storage engine directly, you could get a speed increase of two to five times compared to using the SQL interface. To be able to do this, the data must be on the same server as the application, and usually it should only be accessed by one process (because external file locking is really slow). One could eliminate these problems by introducing low-level MyISAM commands in the MySQL server (this could be one easy way to get more performance if needed). By carefully designing the database interface, it should be quite easy to support this type of optimization.
If you are using numerical data, it's faster in many cases to access information from a database (using a live connection) than to access a text file. Information in the database is likely to be stored in a more compact format than in the text file, so accessing it will involve fewer disk accesses. You will also save code in your application because you don't have to parse your text files to find line and column boundaries.
Replication can provide a performance benefit for some operations. You can distribute client retrievals among replication servers to split up the load. To avoid slowing down the master while making backups, you can make backups using a slave server. See Chapter 5, "Replication in MySQL."
Declaring a MyISAM table with the DELAY_KEY_WRITE=1 table option makes index updates faster because they are not flushed to disk until the table is closed. The downside is that if something kills the server while such tables are open, you should ensure that they are okay by running the server with the –myisam-recover option, or by running myisamchk before restarting the server. (However, even in this case, you should not lose anything by using DELAY_KEY_WRITE, because the key information can always be generated from the data rows.)
|This article is excerpted from MySQL Administrator's Guide, by MySQL AB (editor) (Sams, 2004; ISBN 0672326345). Check it out at your favorite bookstore today. Buy this book now.


text:
Janet Yellen will be sworn in as chairwoman of the Federal Reserve on Monday at 9 a.m., the U.S. central bank announced Thursday.
Yellen will replace outgoing Fed Chairman Ben Bernanke, whose term as chairman expires on Friday.
Yellen will remain as Fed vice chair over the weekend but will have authority to exercise all duties of the chairwoman, the statement said.
In another bit of house-keeping, earlier this week, the Fed's rate policy committee selected Yellen to serve as its chairwoman, effective on Feb. 1.
The statement made no mention of any public goodbye for Bernanke. It looks like he wants to go without much fanfare.
-- Greg Robb
Follow Greg on Twitter @grobb2000
Follow Capitol Report @capitolreport
More must reads on MarketWatch
Fed stays the course by tapering another $10 billion

subset: commoncrawl


text:
Accounting or accountancy is the measurement, processing, and communication of financial information about economic entity
Accounting is facilitated by :Category:Accounting organizations such as standard-setters, accounting networks and associations and professional accounting body. Financial statements are usually audited by Accounting networks and associations, and are prepared in accordance with accounting standard (GAAP). GAAP is set by various standard-setting organizations such as the Financial Accounting Standards Board (FASB) in the United States and the Financial Reporting Council in the United Kingdom. As of 2012, "all major economies" have plans to Convergence (accounting) towards or adopt the International Financial Reporting Standards (IFRS).IFRS Foundation, 2012. [http://www.ifrs.org/Use+around+the+world/Use+around+the+world.htm?WBCMODE=PresentationUnpublished The move towards global standards]
The history of accounting is thousands of years old and can be traced to Ancient history civilizations.Robson, Keith. 1992. "Accounting Numbers as 'inscription': Action at a Distance and the Development of Accounting." ''Accounting, Organizations and Society'' 17 (7): 685–708. The early development of accounting dates back to ancient Mesopotamia, and is closely related to developments in writing, counting and money; there is also evidence of early forms of bookkeeping in ancient Iran,Oldroyd, David & Dobie, Alisdair: ''Themes in the history of bookkeeping'', The Routledge Companion to Accounting History, London, July 2008, , Chapter 5, p. 96 and early auditing systems by the ancient Egyptians and Babylonians. By the time of Emperor Augustus, the Ancient Roman Government had access to detailed financial information.Oldroyd, David: ''The role of accounting in public expenditure and monetary policy in the first century AD Roman Empire'', Accounting Historians Journal, Volume 22, Number 2, Birmingham, Alabama, December 1995, p.124, [http://clio.lib.olemiss.edu/utils/getfile/collection/aah/id/14276/filename/14276.pdf Olemiss.edu]
Double-entry bookkeeping was pioneered in the Jewish community of the early-medieval Middle East Parker, L. M., "Medieval Traders as International Change Agents: A Comparison with Twentieth Century International Accounting Firms," The Accounting Historians Journal, 16(2) (1989): 107-118.''MEDIEVAL TRADERS AS INTERNATIONAL CHANGE AGENTS: A COMMENT'', Michael Scorgie, The Accounting Historians Journal, Vol. 21, No. 1 (June 1994), pp. 137-143 and was further refined in medieval Europe. With the development of Joint-stock company, accounting split into financial accounting and management accounting.
The first work on a double-entry bookkeeping system was published in Italy, by Luca Pacioli ("Father of Accounting").Lauwers, Luc & Willekens, Marleen: "Five Hundred Years of Bookkeeping: A Portrait of Luca Pacioli" (Tijdschrift voor Economie en Management, KU Leuven, 1994, vol:XXXIX issue 3, p.302), [https://lirias.kuleuven.be/bitstream/123456789/119065/1/TEM1994-3_289-304p.pdf KUleuven.be] Accounting began to transition into an organized profession in the nineteenth century,
The word "accountant" is derived from the French word . The word was formerly written in English as "accomptant", but in process of time the word, which was always pronounced by dropping the "p", became gradually changed both in pronunciation and in orthography to its present form.Pixley, Francis William: Accountancy—constructive and recording accountancy (Sir Isaac Pitman & Sons, Ltd, London, 1900), p4
Accountancy refers to the Job (role) or profession of an accountant, particularly in British English.
An audit of financial statements aims to express or disclaim an opinion on the financial statements. The auditor expresses an opinion on the fairness with which the financial statements presents the financial position, results of operations, and cash flows of an entity, in accordance with the generally acceptable accounting principle (GAAP) and "in all material respects". An auditor is also required to identify circumstances in which the generally acceptable accounting principles (GAAP) has not been consistently observed.
Tax accounting in the United States concentrates on the preparation, analysis and presentation of tax payments and tax returns. The U.S. tax system requires the use of specialised accounting principles for tax purposes which can differ from the generally accepted accounting principles (GAAP) for financial reporting. U.S. tax law covers four basic forms of business ownership: sole proprietorship, partnership, corporation, and limited liability company. Corporate tax in the United States and Income tax in the United States income are taxed at different rates, both varying according to income levels and including varying marginal rates (taxed on each additional dollar of income) and average rates (set as a percentage of overall income).
Organizations in individual countries may issue accounting standards unique to the countries. For example, in the United States the Financial Accounting Standards Board (FASB) issues the Statements of Financial Accounting Standards, which form the basis of US GAAP, and in the United Kingdom the Financial Reporting Council (FRC) sets accounting standards. However, as of 2012 "all major economies" have plans to Convergence (accounting) towards or adopt the IFRS.
Accounting research is carried out both by academic researchers and practicing accountants. Methodology in academic accounting research include archival research, which examines "objective data collected from Information repository"; experimental research, which examines data "the researcher gathered by Controlled experiments"; analytical research, which is "based on the act of Scientific modelling Theory or substantiating ideas in mathematical terms"; Antipositivism research, which emphasizes the role of language, interpretation and understanding in accounting practice, "highlighting the symbolic structures and taken-for-granted themes which pattern the world in distinct ways"; critical theory research, which emphasizes the role of power and conflict in accounting practice; Case study; computer simulation; and field research.Coyne, Joshua G., Scott L. Summers, Brady Williams, and David a. Wood. 2010. "Accounting Program Research Rankings by Topical Area and Methodology." ''Issues in Accounting Education'' 25 (4) (November): 631–654.
Empirical studies document that leading List_of_accounting_journals publish in total fewer research articles than comparable journals in economics and other business disciplines, and consequently, accounting scholars
Many accounting practices have been simplified with the help of accounting computer-based software. An Enterprise resource planning (ERP) system is commonly used for a large organisation and it provides a comprehensive, centralized, integrated source of information that companies can use to manage all major business processes, from purchasing to manufacturing to human resources.
Accounting information systems have reduced the cost of accumulating, storing, and reporting managerial accounting information and have made it possible to produce a more detailed account of all data that is entered into any given system.
The Enron scandal deeply influenced the development of new regulations to improve the reliability of financial reporting, and increased public awareness about the importance of having accounting standards that show the financial reality of companies and the objectivity and independence of auditing firms.
In addition to being the largest bankruptcy reorganization in American history, the Enron scandal undoubtedly is the biggest audit failure.Bratton, William W. "Enron and the Dark Side of Shareholder Value" (Tulane Law Review, New Orleans, May 2002) p. 61 It involved a Accounting scandals of Enron and their auditors Arthur Andersen, which was revealed in late 2001. The scandal caused the dissolution of Arthur Andersen, which at the time was one of the five largest accounting firms in the world. After a series of revelations involving irregular accounting procedures conducted throughout the 1990s, Enron filed for Chapter 11 bankruptcy protection in December 2001.
One consequence of these events was the passage of Sarbanes–Oxley Act in the United States 2002, as a result of the first admissions of fraudulent behavior made by Enron. The act significantly raises criminal penalties for securities fraud, for destroying, altering or fabricating records in federal investigations or any scheme or attempt to defraud shareholders.Aiyesha Dey, and Thomas Z. Lys: "Trends in Earnings Management and Informativeness of Earnings Announcements in the Pre- and Post-Sarbanes Oxley Periods (Kellogg School of Management, Evanston, Illinois, February, 2005) p. 5


text:
Blouses & Shirts Wholesale
Shirt blouse with golden buttons M908
A ladies shirt blouse, with plain structure, loose cut. V neck, with golden buttons. Long sleeves, cuffs with two buttons. Bell-shaped hem, asymmetrical. SLightly see-through. Soft and pleasant for the (...)
Blouses & Shirts Wholesale
Fashfactory.com wholesale warehouse offers a wide selection of elegant women's shirts as well as more casual tops and formal blouses in trendy styles and interesting colours.The range of items offered here caters to the tastes of those of our clients who enjoy classic colours, as well as those who prefer bright, more daring hues. In our store you will find shirts, blouses, jumpers and tops in all shades: intense azure, lime and red, powder pink and beige and many others.
All blouses presented in this category are also varied in style and cut so that every woman can find something for herself: tops, turtlenecks, night-outs, collared, business style and party wear, wrap tops, cropped etc. They include a wide range of fabrics, such as cotton or viscose, as well as sizes, e.g. extra small or plus sizes, and patterns prints and embellishments, not to mention long, short and 3/4 sleeves or sleeveless ones, round and boat necks etc.
Most of all this category includes all new arrivals and customer favourites to keep you up to date with the trends, fashion and the seasons.


text:
Call Us: 760.469.4055 | Visit Us: 75153 Merle Drive Suite B. Palm Desert, CA 92211 | E-mail us: email@example.com
Impression Design Group is your one-stop shop for all of your company's marketing needs. Whether you're big or small, a home-based business or a large corporation, we can handle everything, and all in-house here at our Palm Desert location.
We are a full-service marketing company in every sense of the words. Walk into our office with an established business or just a great idea, and walk out with a blueprint for success. We can design a new logo, a state of the art website, and a customized marketing plan. We also offer on-site screen printing and embroidery, along with a full line of promotional products, so everything you need will be in one place.
We specialize in website design, graphic design (including logo and identity design), embroidery, screen printing, promotional items, SEO, mass email and online marketing, large format printing and banners.


text:
Wilson County, NC Court Records Search archive offers an anthology of information and specifics with regard to the public court case lookups. Now wide variety of genealogy clues can be retrieved with the help of this vast search index. The excellent search expert is all set to provide an array of records and information related to numerous familial particulars and hints.
Wilson County, North Carolina Court Search Index offers access to list of information alimony, ancestral property issues and real estate deeds, guardianship documents, legacy and citizenship particulars etc. All these details might be of great value for promising genealogical research. Despite the variation in law from state to state, no single Court record will be stripped of the information given above.
Now county wise information and specifics related to public and vital records can be accessed through Wilson County Search Index. A huge collection of records and data including county birth certificate information, county death records, county marriage data and volume number, county military and service records, county adoption data, county land assessment records, county allocation details, county census records, immigration and naturalization data, county will and estate records, county probate database and many certain specifics can be easily reclaimed through this search tool.
To obtain the North Carolina Wilson County Records, please provide the information below. When you fill-up the form, make a note : The more fields you fill in, the more detailed result you will get.
Please Provide
I wish to receive updates and additional information from this website.
Our Database is loaded with over 400 million county records which include United States Nationwide Vital Records, Public Record and Information. We offer 24x7x365 Search Expert Support. We are working day and night to collect, authenticate and deliver up-to-date County Records in an easiest way.
Our 24x7 Dedicated
Search Expert Team
Will Search The
Record For you From The
Different Sources in The Web.
- 24x7x365 Dedicate Support Team
- Free Search Expert Support
- Cross verification of individual record.
- 100% Satisfaction Guaranteed.
1. Easy and Instant Search Facility
2. Vast Collection of Vital Records - BMD Birth Marriage Death
3. Variety of Public Records USA Nationwide
4. 24x7x365 Search Support along with Special Search Experts to Assist You Anytime
County Records API | Public Records API | Background Check API
Copyright © 2019 county-record.net . All rights reserved.
By using the website (county-record.net), you are complying with the privacy policies & terms of services. Further using of the website (county-record.net), or database or data please refer to our privacy & terms of service pages..


text:
Alert 2013-21
Subject: Counterfeit Cashier's Checks
Date: November 1, 2013
Description: Universal Bank, West Covina, Calif.
Counterfeit Cashier's Checks: Universal Bank, West Covina, Calif.
To: Chief Executive Officers of All National Banks and Federal Savings Associations; All State Banking Authorities; Chairman, Board of Governors of the Federal Reserve System; Chairman, Federal Deposit Insurance Corporation; Conference of State Bank Supervisors; Deputy Comptrollers (Districts); Assistant Deputy Comptrollers; District Counsels; and All Examining Personnel
The above-named bank has reported that counterfeit cashier's checks are being presented for payment nationwide in connection with various mystery-shopping scams.
The counterfeit checks resemble the authentic items but may be identified by the following: Counterfeit items are blue in color with a marbled background and contain all black font. One of the following security warnings may be located in a dark blue border along the top of the check:
Counterfeit items presented to date have been made payable in the amounts of $1,680, $1,870, and $1,980 and have contained remitter names of "Dr. Robert Walton," Scott Young Sr.," or "Dennis Garner." The checks are being mailed to potential victims along with correspondence containing the letterhead "Precision Research Inc., U.S. Office: 1215 6th Avenue, 15th Floor, New York, NY 10020; Phone: (518) 531-8615; SMS# (646) 583-5895" or "Nichole Best Retail Security System, Inc., 6035 North Dale Mabry, Tampa, FL 33614, email@example.com, email@example.com, Office Phone: (813) 408-7721, Text Phone: (872) 222-9571." The letters explain that the recipient is to use the majority of the funds to send wire transfers to various individuals. The letters may be signed by Dennis Garner and contain an e-mail contact of email@example.com.
For additional information and guidance and to verify the authenticity of Universal Bank's cashier's checks, please contact Irma Sanchez, Branch Administration, by mail at 3455 Nogales St., West Covina, CA 91792, by telephone at (626) 854-2818, ext. 194, by fax at (626) 854-5377, or by e-mail at firstname.lastname@example.com.
Consumers who receive a counterfeit or fictitious item and associated material should file complaints with the following agencies, as appropriate:
Additional information concerning this matter that should be brought to the attention of the Office of the Comptroller of the Currency (OCC) may be forwarded to
For additional information regarding other types of financial fraud, please visit the OCC's anti-fraud resource at www.occ.gov/fraudresources.htm.
Ellen M. Warwick


text:
Create a Ning Network!
Join Tennisopolis : Tennis Social Network
Wanna hit with me? I live in UTC area.
Welcome toTennisopolis : Tennis Social Network
Sign Up (free)or Sign In
© 2019 Created by Mark / The Mayor.
Powered by
Badges |
Report an Issue |
Terms of Service
Please check your browser settings or contact your system administrator.


text:
Advanced Search |
Search Tips
We promise to never spam you, and just use your email address to identify you as a valid customer.
This product hasn't received any reviews yet. Be the first to review this product!
All prices are in USD
Copyright 2019 Bailey Bea Designs.
Sitemap |
A Third Eye Graphic Solutions Creation |
Shopping Cart Software by BigCommerce


text:
Interview is scheduled to be conducted on Saturday, 5th May 2012
Job Openings in Vickram College of Engineering, May 2012
- Position: Associate Professor / Professor
- Department: CSE, EEE, ECE, CIVIL, MECH
- Salary: Rs. 12,00,000/- (Rupees Twelve Lakhs per Annum)
- Eligibility: Ph.D with Post Graduation in engineering, and 5 years of experience.
- Contact: 96009 55075 and fix a convenient time for interview


text:
[Funeral Program for Lori Gail Young, March 4, 2008]
Description: Funeral program for Lori Gail Young, born January 9, 1959 and died February 29, 2008. The first funeral service was held March 4, 2008 at Victory Gospel Chapel. The second funeral service was held March 8, 2008 at East Saint Paul Baptist Church in Fort Worth, Texas, officiated by Reverend Carl W. Nealy. Funeral arrangements were made through Carter Taylor Williams Mortuary, and she was buried in Cedar Hill Memorial Park in Fort Worth, Texas.
Date: March 4, 2008
Item Type: Refine your search to only Pamphlet
Partner: San Antonio Public Library


text:
Editor's note: This account of the day's statehood festivities appeared in the June 20, 1863, edition of the Daily Intelligencer of Wheeling.
This day ushers into being the new State of West Virginia, and adds the thirty fifth star to the constellation of the American Union. Today is the beginning of a new order of things with us here. The old Government goes out and the new one comes in. Today Gov. Pierpont goes out and ... Gov. Boreman will be inaugurated as his successor. With the one the parting cannot be but sad. With the other the greeting cannot but be joyful. Gov. Pierpont goes to his new field of usefulness and labor, followed by the good wishes and benedictions of a grateful people. Gov. Boreman comes to us a worthy successor, the unanimously chosen and honored Chief Magistrate of the new State. While we gratefully remember the one, let us honor and support the other.
The new Commonwealth starts upon its career in the midst of turbulence and danger. Its officers have great difficulties and embarrassments to encounter. They will need the moral support of the whole people, and they are worthy of it. Let us give it to them in unstinted measure.
Today the Legislature of the new State meets for organization. With the beginning of the week it commences the important labor assigned it, of putting the machinery of the new Government into smooth and successful operation. It has an arduous task before it, but, we believe the task will be creditably done.
The occasion is a peculiarly suggestive one, but we do not propose to indulge a retrospect now. Today we enter into the reward of the long and toilsome struggle. Two years ago, this day, the people of Western Virginia, in Convention assembled signed the Declaration against the despotic usurpation and conspiracy at Richmond. That declaration embodied the spirit of all this Western Virginia movement, which on this, the second anniversary of that act, stands completed and consummated. Never may we depart from either the spirit or letter of that Declaration, which declared that "the true purpose of all government is to promote the welfare and provide for the protection and security of the covered," and that the rebellion at Richmond seeks "to subvert the Union founded by Washington and his co-patriots, in the purer days of the Republic, which has conferred unexampled prosperity upon every class of citizens and upon every section of the country."
Let us not forget that our New State, which we inaugurate today amid happy auspices, will be destroyed, the liberty it protects overthrown, and the hopes it inspires blasted, if the federal government is not able to sustain itself and enforce its authority. Our fate and the fate of our national Union must be the same. We go on together to prosperity, or we go down together to ruin. Even now the enemies of the country threaten to invade our homes, and the citizens soldiery is under arms for their defense. Let us each and all vow today, in turning this new leaf of our history, undying hostility to this atrocious rebellion which seeks the destruction of the rights of men, and realty to the government and Union, in and under which alone life, liberty and property are secure. As citizens we are of the State, but as patriots we belong to the whole country.
THE INAUGURATION - This will be a big day in the city of Wheeling. Already the hotels are filled with people who have come to witness the inauguration of the Governor of the new State of West Virginia. For the benefit of the public we re-publish the following order of arrangements for the occasion:
1. The Governor elect, members of the Senate and House of Delegates elect, and State officers of the State of West Virginia, and the Governor and State officers of the State of Virginia, are respectfully requested to meet at the McLure House at 9 o'clock, A.M.
2. The 4th and 5th Regiments of West Virginia militia, fully armed and equipped, will parade on Fourth Street, the right of the Fifth resting on Monroe street, at 8 o'clock A.M. After forming the brigade and receiving the General Assembly and officers of the Government at the McLure House, the column will march by the following route, viz: Along Market to John street, thence to Main street, thence to Second street, thence to Chapline street, thence to Market street, thence to Union street, thence to Fourth street, thence to John street, thence to Fifth street and thence to the Linsly Institute.
3. In front of the Linsly Institute, Gov. Pierpont will deliver his valedictory, and introduce Hon. Arthur I. Boreman the governor-elect of West Virginia, who will deliver his inaugural address.
4. At the conclusion of his address Gov. Boreman will cause the national flag to be raised over the Linsly Institute, the temporary Capitol of West Virginia, and a national salute of thirty-five guns will be simultaneously fired.
5. After the two Houses of the General Assembly shall have retired to their respective chambers, the brigade will move to their parade ground and be there dismissed.
6. Citizens are requested to close their places of business between the hours of 8 A. M. and 1 P. M., and display the national flag.


text:
|Thread Tools
|Display Modes
Junior Member
Join Date: Jul 2009
Posts: 3
Moscow, ID PCOS college student
My name is Alicia and I live in Moscow Id. I have almost always been on birth control since I started my period. I met my fiance in high school so my mom made me get on it when i was 15 and I started at 13. Just not to long ago I decided to get off the birth control and didn't have a period for nearly 4 months. I for sure thought I was pregnant but I wasn't so I went to the doctor and they did a whole bunch of tests and she told me I had PCOS. She never really went on there from then, I just decided to go back on the pill and started my period again. I am really confused as to what I should do. My whole life I have wanted a family and I have no idea what I am suppose to do to help with my PCOS and I don't even know if my doctor diagnosed me right, I think she did b/c I have all the right symptoms; however, it is just a general family doctor. Can anyone help me please. Let me know of someone I could go see that isn't extremely far away and if you have any suggestions please let me know. If I were to end up not being able to have children I would be devastated. Thanks.
Senior Member
Join Date: May 2009
Location: Blacksburg, VA (Go Hokies!)
Posts: 203
Hello Alicia!
I'm not from Moscow, I'm from much much further south, Idaho. Right outside of Boise, but not, it's weird. ANYHOW! I don't have anyone in mind that would be close to you, but an OB/GYN is your best bet, many of them understand and can proerly help you with PCOS.
As for suggestions, I would just stick to a diet and exercise plan, and keep your stress levels under control. PCOS isn't the end of the world, and you're definitely not alone (if it's what you actually have!)
There is a chance of infertility in women with PCOS, but they have ways to help that now. Replacement hormones and what not, so I wouldn't worry about it at this point in your life. If you need assurance, cruise through the pregnancy forum and some of the others. There are SO many success stories, it's a confidence boost.
Again, know that you're not alone and take comfort in that. I would just cruise through some of the forums, you'll find all kinds of information relating to PCOS and how people have overcome them. If you want to vent or something, feel free to message me. I can throw some advice your way if I have any and/or just listen
~When life rains on your parade, BRING OUT THE SLIP 'N SLIDE!~
Diagnosed PCOS May 2009
Diagnosed Hypothyroid 2006ish
2250mg Metformin
50mcg Levothyroxine
1200mg Fish Oil x2
Centrum Ultra for Women
Super Vitamin B Complex
Misc. meds for depression/anxiety/ADD/Insomnia
Not TTC, Following a balanced diet (Proper calories, fat, protein, fiber, Calcium)
Junior Member
Åñëè âû õîòèòå ñûãðàòü âî ÷òî-òî êëàññíîå, ãåðîé âîçðîæäåíèå îíëàéí èãðà - ýòî âåëèêîëåïíîå ðåøåíèå.
Åñëè âû õîòèòå ñûãðàòü âî ÷òî-ëèáî êëàññíîå, ãåðîè âîçðîæäåíèÿ èãðàòü îíëàéí - ýòî ãîäíîå ðåøåíèå.
|Thread Tools
|Display Modes
Linear Mode


text:
888.632.2633 (888.NEC.CODE) 3604 Parkway Blvd, Ste 3, Leesburg FL 34748
"... as for me and my house, we will serve the Lord" [Joshua 24:15]
Mike Holt's Best-Selling Illustrated Code Guides bring the code to life. Save $18.00 when you purchase them together with his NEC Exam Practice Questions Book which provides over 2,400 practice questions on the NEC to test your knowledge
In this package you will receive:
· Understanding the NEC Volume 1 Textbook [Articles 90 - 480]
· Understanding the NEC Volume 2 Textbook [Articles 500 - 820]
· NEC Exam Practice Questions Textbook
Answer keys are included with all Mike Holt books.
Due to the extensive content of Article 690, that article is covered in Mike Holt's Understanding the NEC Requirements for Solar Photovoltaic systems. You can view our products covering Article 690 by clicking here.


text:
All poems that appear have been submitted and reprinted with the permission of the authors. Copyrights are retained by the original authors and you must contact them for permission to reprint. If you have a poem you'd like to submit yourself please send it to email@example.com
Bruised and Beaten
©2001 Anonymous.
Reprinted with Permission.
Bruised and Beaten
©2001 Anonymous. Reprinted with Permission.
Copyright ©1998-2019 The Something Fishy Website on Eating Disorders: All rights reserved.
Terms & Conditions, Privacy Policy


text:
No, Kanye West Did Not Make Fun of Handicapped Fans at His Australian Concert
This weekend you may have seen angry Facebook posts from friends and family saying that the "crazy" Kanye West made fun of a wheelchair-bound fan at his Australian concert for not being able to stand up before performing one of his songs.
Though we love to rail on West for his egotistical antics, the story is a bit different than that. As you can see at the 1:00 mark, West does implore the audience to stand up, he quickly realizes his mistake at around the 2:30 mark when he calls out two fans for not standing. After seeing that one is in a wheelchair he says that it's "fine" and continues playing as usual.
The moral of the story? West is not entirely some self-serving ego monster and even knows how to laugh at himself a bit when he makes a mistake. Is he a bit of a dingus? Sure. But leave the outrage at the door, please.