rss

Namazu with PHP5 on Linux

1

Category : Featured, PHP

Namazu is a full-text search engine intended for easy use is what the namazu site tells its users. I have already worked on namazu and it worked amazingly fast. Recently i started working on a project having tens & thousands of records and it was cumbersome for MySQL to work efficiently under that much load. I decided to use namazu for that but unfortunately i was working on a windows based platform and its very difficult to configure PHP5 with namazu on windows. I was able to install namazu easily on windows. One can use the CGI mode to use namazu on windows but installing namazu as a PHP extension is difficult at least for me at this time.

But i was able to install namazu on LINUX and was also able to install namazu as a PHP extension on LINUX. While stumbling though site searching for installing namazu with PHP5 i got this link which describes how one can install namazu on LINUX and its PHP extension also.

I will keep on searching how to get namazu as a PHP extension, meanwhile you can use this link to get namazu working on LINUX.

Share

EPUB for MySQL documentation, Farewell CHM

Category : MySQL

The official logo of the database query MySQL
The official logo of the database query MySQL
Image via Wikipedia

For MySQL has published its docs this time in EPUB format, other docs formats are also available. CHM has been the de facto standard file format for help on windows. The CHM technology is getting a bit behind as more formats are available in the market that makes the document available on many different formats. Microsoft introduced a new successor format with windows Vista i.e AP Help but it doesn’t got the popularity, because of this many have started providing the docs in PDF format.

MySQL has been providing the the CHM file format docs but that has its own problems which require time to handle. With the increasing complexity and size of our documentation (the MySQL 5.1 Manual contains more than 1.6 million words now!), providing CHM has become more and more of a pain. MySQL has stopped shipping CHM with the MySQL Server on Windows months ago.

MySQL has started providing EPUB-format docs. EPUB (see http://en.wikipedia.org/wiki/EPUB) is an open standard format for screen readers, mobile or not, and is fairly easy (and not resource-intensive!) to compile.

Go to http://dev.mysql.com/doc to grab MySQL documentation in EPUB format. To read EPUB on desktop machines, I use a Firefox add-on & calibre-0.7.17, unsurprisingly called epubreader, which loads EPUB documents fast and renders them nicely. That said, please be aware that EPUB can’t do anything about the fact that the MySQL Reference Manual is huge, so downloading it to a mobile device can take a while. The MySQL 5.1 Manual is currently a whopping 15 MB!

Share

ERROR 126 (HY000): Incorrect key file for table

2

Category : MySQL

I had a table with 62 Millions records with total size on disk as 1.2 GB.
What i was doing was joining this table with other table having 80 thousand records.

While running the query the MySQL server showed me an error

ERROR 126 (HY000): Incorrect key file for table

The problem behind this  was related to the size of the temp directory, there was not enough memory on the drive where the temp directory was located.
SOLUTION
Try to change the location of the MySQL tmp directory to a place where there is lots of space. you can do this by editing the MySQL config file and adding this entry

tmpdir=”/path/to/the/temp/directory”

Share

Retrieving nth Salary from DB

1

Category : General

This query lets you find the nth highest salaries employees.

Select * From @Table [T1] Where
(2 = (Select Count(Distinct [ESalary]) From @Table [T2] where [T1]।[ESalary] <= [T2].[ESalary]))

Replace 2 with 3,4 ,5,6 etc to get the 3,4 ,5,6 etc highest salaried employees

Share

Essential Mac Software

Category : General

Share

5 ways to optimize mysql inserts

Category : Information

 

by Justin Silverton

The following are five ways to improve queries involving table inserts:

1) use LOAD DATA INFILE when loading data from a text file

This is around 20 times faster than using insert statements.

2) use INSERT statements with multiple VALUES lists to insert several rows at a time

This is many times faster than using separate single-row insert statements. Tuning the bulk_insert_buffer_size variable can also make inserts (to tables that contain rows) even faster.

3) enable concurrent inserts for myisam tables

The concurrent_insert system variable can be set to modify the concurrent-insert processing. By default, the variable is set to 1. If concurrent_inserts is set to 0, concurrent inserts are disabled. If the variable is set to 2, concurrent inserts at the end of the table are allowed even for tables that have deleted rows.

4) use insert delayed

This is useful if you have clients that cannot or need not wait for the insert to complete. This is a common situation when you use MySQL for logging and you also periodically run select and update statements that take a long time to complete. When a client uses insert delayed, the server returns right away, and the row is queued to be inserted when the table is not in use by any other thread. Another benefit of using insert delayed is that inserts from many clients are bundled together and written in one block. This is much faster than performing many separate inserts.

5) lock your tables before inserting (for non-transactional tables)

This benefits performance 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 insert statements. Explicit locking statements are not needed if you can insert all rows with a single insert.

To obtain faster insertions for transactional tables, you should use start transaction and commit instead of lock tables. 

 

Reblog this post [with Zemanta]
Share

Amit Yadav is Stephen Fry proof thanks to caching by WP Super Cache