Professional Web Applications Themes

performance issue while using select - MySQL

Hi All, I was wondering If there is any computational difference between:-  1) select * from tab1 where id = "1" AND 2) select * from tab1 where id = 1 I have seen that both return the result but if I use query (1) at times instead of (2), will the performance go down.id is of type int. I'll appreciate if anyone explains me this. Regards gaurav...

Sponsored Links
  1. #1

    Default performance issue while using select

    Hi All,

    I was wondering If there is any computational difference between:- 

    1) select * from tab1 where id = "1" AND
    2) select * from tab1 where id = 1

    I have seen that both return the result but if I use query (1) at
    times instead of (2), will the performance go down.id is of type int.

    I'll appreciate if anyone explains me this.

    Regards
    gaurav

    Sponsored Links
    gaurav Guest

  2. #2

    Default Re: performance issue while using select

    gaurav v bagga wrote: 

    If this is an int field, the first query should be illegal. Values
    surrounded by quotes are compared to text fields.

    Additionally, the "1" is a non-standard extension to the ANSI SQL
    standard. The standard is to use single quotes ('1'). The SQL would
    not be compatible with other databases, and even MySQL will reject it if
    it is set up to follow ANSI standards.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: performance issue while using select

    Hi,

    Thanks for the reply was helpful.

    Regards
    gaurav





    gaurav Guest

Similar Threads

  1. select * performance question
    By Chad in forum MySQL
    Replies: 4
    Last Post: December 18th, 12:44 PM
  2. Performance issue
    By samb1 in forum Macromedia ColdFusion
    Replies: 2
    Last Post: April 20th, 01:20 PM
  3. AIX Performance issue
    By Khurram in forum AIX
    Replies: 2
    Last Post: January 30th, 10:47 AM
  4. Performance of dynamically generated select boxes
    By Luis in forum PHP Development
    Replies: 2
    Last Post: October 29th, 06:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139