mysql - [PHP-PDO What is making my query slowdown? -


we working on private forum solution , have table of "posts" has :

  1. 1 index (primary key)
  2. unique key ( i.e. slug / seo-url of respective post )
  3. 2 foreign keys ( refering category(id) , user(id) category of post , op of post.

now, id ( primary key), category (id) , user(id) int(11) unsigned , have used following , results in 0.2xx seconds (on php page):

  • using php pdo
  • using php-mysqli
  • using php pdo persistent connection , buffered queries

query: both give same performance (in range of 0.17-0.2xx seconds)

  1. select rows post,category,user post.userid=user.id , post.categoryid=category.id , post.id=1; -> gives result in 0.17 0.28 seconds on average
  2. select wors post inner join category on post.categoryid = category.id inner join user on post.userid = user.id -> tag bid faster earlier still on slower part.

now when use mybb or phpbb , part of testing, things load all queries including selecting sessions, updating row , inserting within 0.2 seconds. softwares doing?

we used pdo connection, prepare, bind execute.same mysqli.

as forward step, created view necessary columns 3 tables in 1 view again gives same performance.

what doing wrong, single query takes 0.18-0.2xx seconds whereas complete page gets displayed (with more 1 select+update+select) faster.

case: mybb / phpbb , customised forum used on same machine same php-mysql configuration , 2 users simulataneously accessing site (1 user 2 different browsers)

what doing wrong

you looking in wrong direction. every measure took has nothing query performance.

what have study explain output given queries, , set indexes accordingly, make these queries use indexes tables involved.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -