Sponsored Content
Full Discussion: MySQL Performance Problems
The Lounge What is on Your Mind? MySQL Performance Problems Post 303042001 by Neo on Wednesday 11th of December 2019 12:03:53 AM
Old 12-11-2019
Just shaved about 200ms from the mysql query used on the user badge page for each user by adding a field in the user database to store the total tag count for each user and moving that query to a daily cron file instead of updating this in real time.

Code:
<?php
$sql = "select userid, count(1)  as tagcount  FROM tagthread group by userid order by tagcount desc";
$taginfo = $vbulletin->db->query_read($sql);
while ($tag = $vbulletin->db->fetch_array($taginfo)) {
    $sql2 = "update user set tagcount = " . $tag['tagcount'] . " where userid = " . $tag['userid'];
    $vbulletin->db->query_write($sql2);
}

 

4 More Discussions You Might Find Interesting

1. AIX

Performance and paging problems

... a disk drive to be 100% busy? hdisk0 100.0 1.3K 342.7 1.3K 22.0 PgspIn 651 % Noncomp 75.5 hdisk1 100.0 1.3K 320.2 1.2K 20.0 PgspOut 6 % Client 75.5 It's really slowing down performance on my system and I would like to know what is causing this. ... (2 Replies)
Discussion started by: bbbngowc
2 Replies

2. SCO

CPU Performance Problems on VMWARE

hi We have migrated SCO 5.0.6 into ESX4, but the VM eats 100% of the virtual CPU. Here is top print from the SCO VM: last pid: 16773; load averages: 1.68, 1.25, 0.98 02:08:41 79 processes: 75 sleeping, 2 running, 1 zombie, 1 onproc CPU states: 0.0% idle, 17.0% user,... (7 Replies)
Discussion started by: ccc
7 Replies

3. AIX

AIX 5.3 performance problems

Hello, I encounter some performance issues on my AIX 5.3 server running in a LPAR on a P520. How do I investigate performance issues in AIX. Is there any kind of procedure that takes me to the steps to investigate my server and find the sub systems that is causing the issues? The performance... (1 Reply)
Discussion started by: petervg
1 Replies

4. Programming

Xlib - Rotation and interpolation of pixmap - Performance problems

I need to rotate a pixmap in XLib with some kind of interpolation to reduce the aliasing. I came up with the following code, which uses bilinear interpolation. It works fine: the rotated image looks perfect, but unfortunately it takes 5 or 6 seconds for each rotation. (in a 300x300, 16 colours... (5 Replies)
Discussion started by: mghis
5 Replies
Prelude(1)							   User Commands							Prelude(1)

NAME
preludedb-admin - tool to copy, move, delete, save or restore a prelude database SYNOPSIS
preludedb-admin copy|move|delete|load|save arguments DESCRIPTION
preludedb-admin can be used to copy, move, delete, save or restore a prelude database, partly or in whole, while preserving IDMEF data con- sistency. Mandatory arguments copy Make a copy of a Prelude database to another database. delete Delete content of a Prelude database. load Load a Prelude database from a file. move Move content of a Prelude database to another database. save Save a Prelude database to a file. Running a command without providing arguments will display a detailed help. EXAMPLES
Obtaining help on a specific command: # preludedb-admin save Usage : save <alert|heartbeat> <database> <filename> [options] Example: preludedb-admin save alert "type=mysql name=dbname user=prelude" outputfile Save messages from <database> into [filename]. If no filename argument is provided, data will be written to standard output. Database arguments: type : Type of database (mysql/pgsql). name : Name of the database. user : User to access the database. pass : Password to access the database. Valid options: --offset <offset> : Skip processing until 'offset' events. --count <count> : Process at most count events. --query-logging [filename] : Log SQL query to the specified file. --criteria <criteria> : Only process events matching criteria. --events-per-transaction : Maximum number of event to process per transaction (default 1000). Preludedb-admin can be useful to delete events from a prelude database : preludedb-admin delete alert --criteria <criteria> "type=<mysql> name=<dbname> user=<prelude-user> pass=<pass>" where criteria is an IDMEF criteria : preludedb-admin delete alert --criteria "alert.classification.text == 'UDP packet dropped'" "type=mysql name=prelude user=prelude-user pass=prelude-pass" This will delete all event with the classification text "UDP packet dropped" from the database. SEE ALSO
The Prelude Handbook: https://trac.prelude-ids.org/wiki/PreludeHandbook Prelude homepage: http://www.prelude-ids.com/ Creating filter using IDMEF Criteria: https://trac.prelude-ids.org/wiki/IDMEFCriteria Prelude IDMEF Path: https://trac.prelude-ids.org/wiki/IDMEFPath BUGS
To report a bug, please visit https://trac.prelude-ids.org/ AUTHOR
This manpage was Written by Pierre Chifflier. COPYRIGHT
Copyright (C) 2006 PreludeIDS Technologies. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. preludedb-admin June 2007 Prelude(1)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy