Forum Moderators: open

Message Too Old, No Replies

Do you need auto_increment for searching?

         

linux_19

11:48 pm on Jun 27, 2006 (gmt 0)



Hi all,
As far as I know the primary key isn't needed for searching...but I also heard that it can speed up the work in some way..when exists.I am running currently one search engine with over 500 000 records and it's kind a slow(<snip>) ...so I hesitate whether to include one new field in my db containing autoincrement/primary key.

[edited by: physics at 11:49 pm (utc) on June 27, 2006]
[edit reason] No self promo. [/edit]

physics

11:53 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I imagine the columns that are being searched are varchar or text right? In that case you want to index the rows that are actually being searched (FULLTEXT index in the case of text columns). I always recommend the use of numerical primary keys so that you have something short and unique to refer to each row when pulling out data, but this might or might not help much in your case.
[dev.mysql.com...]