MySQL Forums
Forum List  »  Newbie

Re: appropriate database design and query
Posted by: gaurav mishra
Date: January 15, 2009 01:36AM

Thanks for the reply.
We are not storing images in the database, so we don't need any blob data type, all are integer values between 0 and 20000 with maximum values in the range 0 to 1000.

The problem is we don't have a single table. Presently we have 8 tables each with 320 columns to accommodate (320*8=)2560 values corresponding to each image.
Is the number of tables appropriate?

Following your description, the query should be
SELECT imageId from table1
using (imageId)
using (imageId)
table8 using (imageId)
WHERE table1.a BETWEEN ?-20 and ?+20
AND table1.b BETWEEN ?-20 and ?+20
AND table1.c BETWEEN ?-20 and ?+20
table2.a BETWEEN ?-20 and ?+20
AND table2.b BETWEEN ?-20 and ?+20
AND table2.c BETWEEN ?-20 and ?+20
table3.a BETWEEN ?-20 and ?+20
AND table3.b BETWEEN ?-20 and ?+20
AND table3.c BETWEEN ?-20 and ?+20
table8.a BETWEEN ?-20 and ?+20
AND table8.b BETWEEN ?-20 and ?+20
AND table8.c BETWEEN ?-20 and ?+20

Am I right?

Options: ReplyQuote

Written By
Re: appropriate database design and query
January 15, 2009 01:36AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.