niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL
Very slow query
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Michael Sutter
*nix forums beginner


Joined: 23 Mar 2006
Posts: 5

PostPosted: Fri Jul 21, 2006 1:10 pm    Post subject: Very slow query Reply with quote

Hello everbody,

I have a table in my MySQL 5.0.22 Server with this columns.

+--------------+--------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------------------+-------+
| DATE | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| IMAGE | longblob | NO | | NULL | |
| IMAGETYPE | varchar(Cool | NO | MUL | NULL | |
| KEYFILE | longblob | NO | | NULL | |
| SEARCHENGINE | varchar(64) | NO | MUL | NULL | |
| SEARCHTERM | varchar(256) | NO | MUL | NULL | |
| SIZE | int(11) | NO | MUL | 0 | |
| URL | varchar(512) | NO | | NULL | |
| NAME | varchar(256) | NO | MUL | NULL | |
+--------------+--------------+------+-----+---------------------+-------+

When I insert several hundert rows with data (all columns, but without
the keyfile column) and query the database with this string:

SELECT date, imagetype, searchengine, searchterm, size, url, name FROM
digiforensic where searchterm='...'

it goes very fast (less than one second) and the right index for
searchterm is used. This even works when I shutdown and restart the server.

The problem is, that the keyfiles are calculated after the datasets are
inserted into the database. After calculation they are inserted with an
update
of the corresponding row. After that the query of the datasets takes a
lot of time - more than 2 minutes. I checked that the right index is
used with the EXPLAIN expression.

Did anybody know why this happens or what my error is?

Thanks and Regards
Michael
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Sat Nov 22, 2008 9:24 pm | All times are GMT
navigation Forum index » Databases » MySQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Column info without executing query Dan Strömberg PostgreSQL 10 Thu Jul 20, 2006 6:21 pm
No new posts recursive query Jürg Schaufelberger Server 1 Thu Jul 20, 2006 6:06 pm
No new posts How to query on part of a date column? Barry Newton MySQL 4 Thu Jul 20, 2006 5:02 pm
No new posts Slow Connectivity via Gigabit Doug V networking 6 Thu Jul 20, 2006 4:16 pm
No new posts Invalid syntax with STD() function when more than one fie... William Bronsema MySQL 1 Thu Jul 20, 2006 2:18 pm

Internet Advertising | WoW Gold | Free Credit Report | Remortgages | Buy Anything On eBay
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1287s ][ Queries: 16 (0.0657s) ][ GZIP on - Debug on ]