Today I learned - Page 17
Page 17 of 17 FirstFirst ... 7151617
Results 241 to 245 of 245

Thread: Today I learned

  1. #241
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,504
    Quote Originally Posted by cluelessPHP View Post
    Today I learned

    PHP Code:
    SELECT count(*)+
    Seems strange to me
    Something else to learn:

    SELECT COUNT(NAME_OF_INDEXED_COLUMN) is always better/faster than SELECT COUNT(*) ...
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  2. #242
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    14,855
    Quote Originally Posted by dalecosp View Post
    Something else to learn:

    SELECT COUNT(NAME_OF_INDEXED_COLUMN) is always better/faster than SELECT COUNT(*) ...
    With an exception for MySQL ISAM-engine tables when only doing SELECT for one table, in which case COUNT(*) is probably faster: https://dev.mysql.com/doc/refman/5.7...function_count
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #243
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Contact Unit "Coping Mechanism"
    Posts
    22,517
    ...And don't use it on a column that allows NULLs (there's a school of thought that says there shouldn't be any such in a database schema anyway, but, well.). Best choice would be (a column from) the primary key 'cos you know there can't be any NULLs there, and it will definitely be indexed.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  4. #244
    Senior Member cluelessPHP's Avatar
    Join Date
    Apr 2015
    Location
    Scotland
    Posts
    460
    Today I learned although the company natural gas may sound funny, buying stock in them for that reason only is not a good idea
    Once you had a good excuse, you opened the door to bad excuses ― Terry Pratchett, Thud
    Fresh start
    Current date 14/10/17
    Finish date "should be" 14/04/18

    Vote on your preferred indentation method

  5. #245
    Senior Member cluelessPHP's Avatar
    Join Date
    Apr 2015
    Location
    Scotland
    Posts
    460
    Today I learned Håkon Wium Lie is who we have to thank in part for that ugly thing called CSS
    Once you had a good excuse, you opened the door to bad excuses ― Terry Pratchett, Thud
    Fresh start
    Current date 14/10/17
    Finish date "should be" 14/04/18

    Vote on your preferred indentation method

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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