• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] use MATCH AGAINST instead of LIKE '%$key%'

Started by dtiberio,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dtiberioTopic starter

don't do database searches this way, it is too slow. the % sign at the beginning of a match requires the db to search through everything.

instead use the MATCH....AGAINST feature with a full text index. it will make the database much much faster. this should be a high priority change to your system. the %$key% method will have a huge performance hit on your database.

WHEN ".DB_PREFIX."videos.description like '%" .$key. "%'

I think it is written MATCH (videos.description) against ($key), not sure. and you have to have that full text index. I think the command is:

alter table vibe_videos add fulltext description_ft (description);

only add the FT index once and never again, other wise it will add it multiple times and it will be slower.
  •  

dtiberioTopic starter

this is okay:

where title like '$key%'

however this is very slow and resource intensive:

where title like '%$key%'
  •  

dtiberioTopic starter

and in both cases you need to have indexes.

so '%$key% and '$key%' might be the same without indexes, but '$key%' is much faster like 100x faster with indexes.
  •  

PHPVibe A.

We did this in 3.1 (or 3.3) and everybody complained about the results.

dtiberioTopic starter

did you use Booleans?

the fact is that you can't use the '%$key%' matching on a large database. it will become slow.
  •  

PHPVibe A.

We did it by the book, if you have other suggestion besides match, we are really looking for one ourselves.

 

Similar topics (7)

Important Announcement: PHPVibe Video Sharing CMS End of Life

Started by Marius P.


Replies: 1
Views: 40668

How to use the PHPVibe user system (internally or externally)

Started by PHPVibe A.


Replies: 0
Views: 9937

insite ads issue when selecting above/below video player location

Started by georgepanaitescu


Replies: 3
Views: 23075

The problem of video viewing PHPVibe 5.0

Started by Nayn


Replies: 25
Views: 71280

embed video does not work on v5

Started by neospider69


Replies: 6
Views: 51519

when slecting to unpublish music mp3 - next page says unpublished video ?

Started by spirog


Replies: 2
Views: 4490

video,playlist,images, etc. (frontend) select all deselect all reselect all

Started by spirog


Replies: 3
Views: 6168