05-14-2016, 12:41 PM
Hi so I am using linkfly url shortener but I have a problem in database my developer fixed the complex script and make it run smooth but another major problem comes my hosting said this
Hi it is a url shortener and my histing said this my developer is a littlebit busy so I need to fix this as soon as possible
However, we see another 'slow' query, which
takes about a second
to complete and downloads the whole 'views' table
from the database for
some reason, with all the rows:
select * from views
It gets about half a million records, nearly every
second, and that
affects your site's performance negatively.
Also, it is
highly recommended to
use some caching in your script, and cache the
database query result,
rather than send the same 'slow' query frequently.
my developers review
Using * is always a problem. Bcoz by using * you are
actually giving MySQL work to find all tables first and
then take the data. Instead of this best is .. If you want
every table then better write SELECT
rowname,rowname1,rowname2 FROM views
Hi it is a url shortener and my histing said this my developer is a littlebit busy so I need to fix this as soon as possible
However, we see another 'slow' query, which
takes about a second
to complete and downloads the whole 'views' table
from the database for
some reason, with all the rows:
select * from views
It gets about half a million records, nearly every
second, and that
affects your site's performance negatively.
Also, it is
highly recommended to
use some caching in your script, and cache the
database query result,
rather than send the same 'slow' query frequently.
my developers review
Using * is always a problem. Bcoz by using * you are
actually giving MySQL work to find all tables first and
then take the data. Instead of this best is .. If you want
every table then better write SELECT
rowname,rowname1,rowname2 FROM views