PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Index or procedure
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Index or procedure

Réponse
 
LinkBack Outils de la discussion
Vieux 17/10/2007, 09h38   #1
Marco Cotroneo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Index or procedure

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.

Thanks for any advice

Marco
  Réponse avec citation
Vieux 17/10/2007, 10h31   #2
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Index or procedure

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.
--
Rik Wasmus
  Réponse avec citation
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
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h42.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08972 seconds with 11 queries