Improving URLs with the FULLTEXT Index

I am currently creating a website with several pages, and in order to decorate the URLs of the sites, I use addresses such as http://mydomain.com/category/item-name

I use MySQL tables, so for extracting the current item from my MySQL, I have two options:

1) Add the item identifier to the header: http://mydomain.com/category/28745/item-name(where 28745is the identifier in the table). That way I can run the query SELECT * FROM products WHERE ID=28745. Easy approach, but the problem is that the url is a bit uglier.

2) Retrieve the item using text search. In this case, I will use the element name as FULLTEXT(using MyISAM), so the request will be SELECT * FROM products WHERE item-name=some-text.

I am trying to find out if there are any flaws in the second approach. Does the value use FULLTEXTinstead of the index in the table INTin performance? Does it really matter for search engines if the URL consists of an identifier and is a little uglier?

Thank,

Meir

+3
source share
4 answers

You do not need a FULLTEXT index, this is the first. The FULLTEXT index is an index used to search for a database of text. What you do is an exact match; you are not looking for a record.

However, what is the disadvantage of having an index over a text column over an integer?

-, . . . , 4 (2 ^ 32 - ). ASCII char 1 . , , 4 , , 4,5 .

-, MyISAM, - . MyISAM InnoDB SO.

- 100k + , - , . , . - .

+2

, . , .

0

, - ?


Edit:

, , , , , , , ? , ID :

http://mydomain.com/category/normal-item
http://mydomain.com/category/item-that-appears-multiple-times/1
http://mydomain.com/category/item-that-appears-multiple-times/2
http://mydomain.com/category/item-that-appears-multiple-times/3
0

pagenumber .
.

:

TableURL
   pageid integer autoincrement primary key
   url varchar(1000)
   pagetext text

URL-, :

$pageid = mysql_real_escape_string(.....);
....
SELECT pagetext from tableurl where pageid = '$pageid'

, db- , .

0

All Articles