Discussion: Index or procedure
Afficher un message
Vieux 18/10/2007, 09h45   #3
Marco Cotroneo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Index or procedure

Rik Wasmus ha scritto:
> On Wed, 17 Oct 2007 09:38:42 +0200, Marco Cotroneo <m.cot@italia.it> wrote:
>
>> Hello,
>> I need to check out if a description is already present in a table
>> while inserting or updating. I am wondering whether use an index on
>> that description or check it in the trigger after/begin insert/update.

>
> It depends on the cicumstances. Having a reasonably 'small' description
> which should be enforced unique in a table would be best served with
> keys. Longer blobs with text I wouldn't make a key of, and just check
> wether it exists before a transaction.
>
> A UNIQUE Key, and using an 'INSERT .... ON DUPLICATE KEY UPDATE ..'
> syntax often does wonders.

Thanks for your replay. :-)
  Réponse avec citation
 
Page generated in 0,09367 seconds with 9 queries