PDA

View Full Version : Runs/Adds Queries


Snake
10-19-2005, 10:28 AM
Hey there's just a little option that you're missing, Runs/Adds Queries, to the right column. It's good to know whether a hack requires to run or add a query, you know.

Supported
DB Changes
Installer included
Uses Plugins
Template changes
Code changes
Additional files
Adds query
Is in Beta stage

Chris M
10-19-2005, 01:22 PM
That's what DB Changes is for ;)

Chris

Alan @ CIT
10-19-2005, 02:41 PM
Why would you want to know if a hack has SQL queries in it?

peterska2
10-19-2005, 03:13 PM
I suppose some people don't like things that need extra queries. Seems to limit them to template mods only then, IMO, as I believe most mods require some form of query or other.

Chris M
10-19-2005, 03:35 PM
DB Changes does not necessarily mean that queries will be ran when executing the Plugin on a day-to-day basis; It could mean that simply a few queries will be ran when installing / un-installing products ;)

Chris

peterska2
10-19-2005, 03:44 PM
Hence why I think it should be two seperate things, ie, uses queries when installing, and uses queries on a day-to-day basis.

Chris M
10-19-2005, 03:48 PM
This won't happen until we move to 3.5, by which point you will be able to define multiple combinations of what your modification does and no longer be confined to guesswork as far as what you select :)

Chris

peterska2
10-19-2005, 03:52 PM
Cool. I'm looking forward to this hacks database, it's gonna be ace.

Chris M
10-19-2005, 03:56 PM
It even comes with a scrolling marquee saying Chris M is the greatest :)

Chris

peterska2
10-19-2005, 04:01 PM
now I've gone off the idea!!!!

Xenon
10-19-2005, 04:13 PM
now I've gone off the idea!!!!

perfect, less work again :)

Andreas
10-19-2005, 04:21 PM
DB Changes = The Hacks modifies the database schema (eg. adding new fields, tables, indexes, etc.)
It has nothing to do with queries it uses to do it's work (gather data to display or whatever).

Corriewf
10-19-2005, 04:23 PM
It even comes with a scrolling marquee saying Chris M is the greatest :)

Chris


Lies it spreads...LIES!

Alan @ CIT
10-19-2005, 04:32 PM
I've never understood this obsession with hacks and their SQL queries.

Merging 4 threads and moving the merged thread to a different forum using inline moderation, runs 102 queries - why would you care if a hack adds a query or 2 that take a fraction of a second to run?

But... that's just me :)

kall
10-19-2005, 07:55 PM
Cool. I'm looking forward to this hacks database, it's gonna be ace.
It's going to be ... me?

Oh... right. :)

Chris M
10-19-2005, 08:00 PM
I've never understood this obsession with hacks and their SQL queries.

Merging 4 threads and moving the merged thread to a different forum using inline moderation, runs 102 queries - why would you care if a hack adds a query or 2 that take a fraction of a second to run?

But... that's just me :)

The only time that could become a concern is with a badly scripted modification that runs excessive queries...

And since the days of 3.0 and especially 3.5 you don't need to execute as many queries thanks to improvements in functionality ;)

Chris

Snake
10-19-2005, 09:56 PM
Oh I'm glad to hear this will be available while we're on 3.5. :)

Lea Verou
11-18-2005, 07:10 PM
Ι remember asking about queries when I didn't even know what a query was! I don't think that everyone that seems so concerned about them really knows how much they add and what a query actually means.
I think some people are obsessed with the number of queries for no reason.
Anyway, DB changes is not complete cause there are hacks that don't affect the database but only run queries to read from it. So a query field is needed since we have those does-it-run-queries maniacs :p :p

noppid
11-18-2005, 07:16 PM
It's not necessarilly the number of queries, but the quality of the queries. One badly written or implemented query can be worse then 100 properly implemented queries.

Lea Verou
11-18-2005, 07:18 PM
It's not necessarilly the number of queries, but the quality of the queries. One badly written or implemented query can be worse then 100 properly implemented queries.

And how do you define a badly written query? :confused:

noppid
11-18-2005, 07:19 PM
And how do you define a badly written query? :confused:

A query that has to do a table scan of records rather then use indexed lookups.

Lea Verou
11-18-2005, 07:22 PM
A query that has to do a table scan of records rather then use indexed lookups.

Hmm I'm not sure what you mean (I'm new to all this) but using indexed lookups is not always possible I think!

noppid
11-18-2005, 07:31 PM
Hmm I'm not sure what you mean (I'm new to all this) but using indexed lookups is not always possible I think!

You should design your tables in advance to accomodate using indexes. On small tables you can cheat. On large tables you can get in trouble. (50Kplus records)

Lea Verou
11-18-2005, 08:04 PM
You should design your tables in advance to accomodate using indexes. On small tables you can cheat. On large tables you can get in trouble. (50Kplus records)

I don't understand :(
Can you please take a look at my referrer statistics hack and tell me what do you think about the queries? :nervous:
Please? :nervous:

Wayne Luke
11-18-2005, 08:33 PM
I don't understand :(
Can you please take a look at my referrer statistics hack and tell me what do you think about the queries? :nervous:
Please? :nervous:

You should recommend placing an index on referrerid for your queries to work better and not result in table scans.

ALTER TABLE `user` ADD INDEX ( `referrerid` )


As the user table is actually very rarely updated, at least compared to other tables, the additional index will decrease the overhead of your hack and not increase the creation or editing times of users substantially.

Read this article for more information:
http://www.databasejournal.com/features/mysql/article.php/10897_1382791_2

Even though your hack only has two queries, it completes two table scans. Table Scans are bad because it copies the entire table into memory and locks it until completed. This means no one's records can be updated or created while it is locked. On a small forum this may take milliseconds as MySQL looks at every record to see if it matches. On large forums it can take several seconds.

Paul M
11-18-2005, 11:18 PM
Most poeple have little idea how sql works, and how useful indexes are, that is why they are obsessed with hacks running "queries". A few simple reads on a well indexed table can take less than 100th of a second to run. Lots of people add fields to tables, but never think about indexes.

Back to the topic, A tick box for Runs/Adds queries is IMO pointless, anything except the most simple of hacks will almost certainly run at least one query. I would not waste my time filling it in.

Alfa1
06-10-2007, 01:43 PM
Would there be another way of defining sever load for a mod? It would be good to know this before installing a hack. Maybe the number of queries or maybe there is another approach?
Myself I like a lot of hacks on vb.org, but installing to many may cause problems I suspect. I would appreciate your view in this.