vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Take it all or what you need (https://vborg.vbsupport.ru/showthread.php?t=55992)

Serge 08-08-2003 01:02 AM

Take it all or what you need
 
Is there really any difference in using the * to select everything for a table then just to select the stuff you need? I'm talking performance wise and if there is any security risks.

Erwin 08-08-2003 01:53 AM

Selecting * will make the database retrieve all variable values - if you don't need to, don't do it, since it's going to waste time and resources.

g-force2k2 08-08-2003 05:12 AM

i feel pretty much the same way as Erwin...

if you're selecting by using * and you're only using one or two rows of a table then you're sacrificing spd for getting data you don't necessarily need...

for instance if you're selecting doing a validation of a username and you only need the username and user then use:

PHP Code:

$user $DB_site->query_first"SELECT userid, username FROM user WHERE userid=$bbuserinfo[userid]); 

rather then using SELECT *

just an example...

regards,
g-force2k2


All times are GMT. The time now is 09:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00926 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete