1.  I would just keep the names in the database table.  Storing the
images themselves would require a blob field, which means that you would
have to run OPTIMIZE TABLE a lot more often to keep it running fast.  If
you just store the name, you can use a varchar.  Not only does it take
up less space, but the size of the data in the field doesn't vary as
much from row to row, so you won't have to run OPTIMIZE as much.

2.  If you want to know if there are duplicates, then you should try
pulling out records that match.  Ex:
"select data1, data2 from table1, table2 where
table1.data1=table2.data2"
or a better example:
"select table1.ProductName from table1, table2 where
table1.ProductName=table2.ProductName and table1.Price=table2.Price
..."  (continue adding the "and"s until all the fields that match up are
listed like this, or just use one or two fields if that's all your
worried about being duplicate)
This will show you all the duplicates.

Pulling out only the records that are NOT duplicate would be a lot more
complicated, and I'd suggest writing some kind of script to pull out of
both tables and compare.  I can write you an example in PHP if this is
what you're looking for.

-Angela



Arthur Radulescu wrote:
> 
> Hi!
> 
> I have 2 questions!
> 
> 1.What is more eficient to keep some images into a table or to keep their names in 
>the table and images separated in a directory?
> 
> 2.How can I join to big tables and verify if there are any duplicates (i have tried 
>just to view the data from those tables with something like "select data1,data2 from 
>table1, table2  where table1.data1 != table2.data2"
> ... and MySQL is out of memory) ?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to