[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SQL performance question



On Monday, 20.11.2006 at 09:05 -0500, Roberto C. Sanchez wrote:

> On Mon, Nov 20, 2006 at 01:13:55PM +0100, Dirk wrote:
> > Which one is faster? Indices of varchar(8) or int(11)?
> > 
> > Or is there no difference at all?
> 
> It probably depends on:
>  * your particular DBMS
>  * your access pattern (few reads/many writes or many reads/few writes)
>  * the size of your tables
>  * many other things

Will also depend on whether you are select-ing/indexing on *equality* or
on partial matches (i.e. substrings for varchar, or
greater-than/less-than for integers).

I'm curious as to why you've asked such an abstract question, Roberto:
do you have a database application in mind whether you are able to use
either strings or integers for a particular storage type?

Dave.
-- 
Please don't CC me on list messages!
...
Dave Ewart - davee@sungate.co.uk - jabber: davee@jabber.org
All email from me is now digitally signed, key from http://www.sungate.co.uk/
Fingerprint: AEC5 9360 0A35 7F66 66E9 82E4 9E10 6769 CD28 DA92

Attachment: signature.asc
Description: Digital signature


Reply to: