DELIMITER // CREATE SCHEMA fractal // USE fractal // CREATE TABLE disp ( id INT PRIMARY KEY, content VARCHAR(1000) ) // CREATE TABLE shade ( id INT PRIMARY KEY, value INT ) // INSERT INTO shade (id,value) VALUES (0,ORD(' ')),(1,ORD('.')),(2,ORD(',')), (3,ORD('-')),(4,ORD('~')),(5,ORD('*')),(6,ORD(':')),(7,ORD(';')),(8,ORD('+')), (9,ORD('o')),(10,ORD('O')),(11,ORD('&')),(12,ORD('%')),(13,ORD('@')) // CREATE PROCEDURE mandelbrot (IN x_max INT, IN y_max INT) BEGIN DECLARE x INT DEFAULT 0; DECLARE y INT DEFAULT 0; DECLARE xf0 FLOAT; DECLARE yf0 FLOAT; DECLARE xf1 FLOAT; DECLARE yf1 FLOAT; DECLARE tf FLOAT; DECLARE l INT; DECLARE l_max INT; DECLARE buffer VARCHAR(1000); DECLARE tint INT; TRUNCATE disp; SELECT MAX(id) INTO l_max FROM shade LIMIT 1; WHILE y<y_max DO SET buffer=''; SET x=0; WHILE x<x_max DO SET xf0=x*4.0/x_max-2.0; SET yf0=y*4.0/y_max-2.0; SET xf1=xf0; SET yf1=yf0; SET l=0; WHILE l<l_max AND xf1*xf1+yf1*yf1<4.0 DO SET tf=xf1*xf1-yf1*yf1+xf0; SET …[Read more]
This document is a user report on the MaxDB Synchronization Manager. The article describes the use of the MaxDB Synchronization Manager during United Drugs Annual Convention from a technical standpoint. It gives an example of the magnitude of possible application of the MaxDB Synchronization Manager. Written for developers, the user report contains warnings on common pitfalls and gives hints how to circumvent the problems.
My friends Theo Schlossnagle, Laura Thomson and Chris Shiflett are each presenting at ApacheCon Europe. They are each excellent presenters with solid content - I have seen Theo present at a previous ApacheCon, caught Laura at several OSCONs and finally saw Shiflett speak at the PHP Quebec conference earlier this year.
The deal is simple - sign up for any of their tutorials before the early bird deadline for the conference closes (on June 6th) and get complementary copies of some of the speaker’s book(s).
The sessions are:
[Read more]
MySQL does not always make a right decision about indexes
usage.
Condsider a simple table:
PLAIN TEXT SQL:
- CREATE TABLE `t2` (
- `ID` int(11) DEFAULT NULL,
- `ID1` int(11) DEFAULT NULL,
- `SUBNAME` varchar(32) DEFAULT NULL,
- KEY `ID1` (`ID1`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT COUNT(*) FROM t2
;
250001 (V1)
SELECT COUNT(*) FROM t2 WHERE ID1=1
;
83036 (V2)
(execution time = 110 ms)
That is index selectivity by condition (ID1=1) is V2/V1 = 0.3321 or 33.21%
It is said (e.g. book "SQL
Tuning") if selectivity over 20% then a full table scan is
preferable than an index access.
As far as I know Oracle alway chooses a full table scan if
selectivity over 25%.
…
[Read more]
Finally i was able to do a benchmark of the 3 search
engines
- mysql fulltext search
- lucene search engine
- sphinx www.sphinxsearch.com
I came across sphinx while doing a search on full text search
engines. It is a very good engine. Few points regarding
sphinx
-> Very simple to configure, create index and search
-> Very easy to integrate with php and mysql. APIs for the
same are also available. I was able to build index and search
using sphinx in a few hours.
-> The index which has been created is a combination of all
fields of mysql. There is no distinction between different fields
being searched. So you can perform search on an index and not on
different fields of the index.
-> Of course since its source code is available, the searching
process can be customized according to your needs. Moreover 0.9.6
version …
Paul McCullagh works on a new pluggable transactional Storage Engine for MySQL, called PrimeBase XT. I met him for an interview a few days ago - you can now read it on the MySQL Developer Zone. Enjoy and have a nice weekend!
Let's say that you are building a new application, and you need
to test it against a large set of data. You would need either to
borrow the data from some known source or to create it
yourself.
If you have such collection at your disposal, good for you. But more often than not you need some sort of data that is not ready in your repositories, and then you need to have a quick method to create it.
I will tell you three quick tricks to create large datasets of
simple data types, namely numbers,
words, and dates.
Le's assume that we need at least one million records. Here's how to go for it.
numbersCreating a large table with just a numeric field is quite
simple.
You may be tempted to run a loop in your favorite language, or
even in a SQL stored procedure, but this approach would run for
quite a long time.
There is a better …
The PrimeBase XT Storage Engine (PBXT) is a new transactional database engine for MySQL. It has been designed for modern, web-based, high concurrency environments. In May 2006, I had the opportunity to meet with Paul McCullagh, the head developer of PBXT for lunch at the Hamburg offices of Snap Innovation GmbH, the company behind PrimeBase. It was co-founded by Paul in February 1996 and is focussed on the development and sales of client/server database technology, specializing in inter- and intranet systems.
Notice something new?
Ok, I made that one easy for you. Thanks to the MySQL AB web team there is finally a tool for flipping between the same page in the different version manuals.
Thanks Markus!
“Few businesses are as spread out as MySQL, which employs 320 workers in 25 countries, 70 percent of whom work from home.”