Job: Create an entire dating site: Architecture, 1 hour, Initial work 2 hours, testing 4 hours, protype developed 1 hour. Pay $25/hr



  • http://newyork.craigslist.org/mnh/eng/989464357.html

    Wow. Whats next, an eBay clone in 3 hours?



  • Go to a website like [url]www.rentacoder.com[/url] and you'll see thousands of requests like that. Including your own suggestion.



  • @Flatline said:

    Go to a website like rentacoder.com and you'll see thousands of requests like that. Including your own suggestion.
    I don't believe he's airing his own request out here, just pointing out the WTF that someone expects this to happen.



  • Candidate must be able to:

    a) spin straw into gold

    b) sprout wings and fly to the sun - on demand

    c) solve all the worlds' problems with a simple arms-crossed-blink

     



  • I'm pretty sure Flatline means the request the OP posted has also found its way to Rentacoder, not that the OP is the one asking for miracles. :)



  • Can´t help but sit and wonder, what is bigger WTF: To expect that somebody will bend space and time AND write functional code for 25 bucks per hour, or to wait 3 years for damn expensive third party developers to add complain-tracking feature to our existing production database (which was created by the very same damn expensive third party at the first place).
    No, really, which one?



  • Over the last week I read "Head First - PHP and MySQL", and one of the examples they give is to actually build a (very) simplistic dating site. So maybe someone should send this guy a link to the book!



  • @OzPeter said:

    Over the last week I read "Head First - PHP and MySQL", and one of the examples they give is to actually build a (very) simplistic dating site. So maybe someone should send this guy a link to the book!
    Does the book do all the work for him?  Because otherwise, I doubt he's interested.



  • @bstorer said:

    @OzPeter said:

    Over the last week I read "Head First - PHP and MySQL", and one of the examples they give is to actually build a (very) simplistic dating site. So maybe someone should send this guy a link to the book!
    Does the book do all the work for him?  Because otherwise, I doubt he's interested.


    You can download the code from the publishers website!


    And given the quality of some of the code, the guy in Manhattan would deserve it.


    Though in all fairness the book was pretty good as an introductory text that covered a very wide range of topics. I just cringed at some of the sub-optimal programming techniques (like using SELECT * FROM .. to determine if there are any rows in a table). Never having used PHP or MySQL before made it an interesting read to find find out what all the fuss is about. On the other hand after using MySQL I was almost pleading for the maturity and level of control in MS-SQL



  • $3,000 OS FTW

     @m1tch37 said:

    Wow. Whats next, an eBay clone in 3 hours?

    And everytime I see posts like this, I reflexively find and post the bookmark for the original (best?) example of "attempting to contract out with no grip on reality whatsoever."



  • They decided to go slightly lower with their goals.

    1. Must be able to perform SQL queries


  • If the original poster wouldn't have said "Wow. Whats next, an eBay clone in 3 hours?", this would be spam :D



  •  I think that using SELECT count(*) ... in MySQL is actually pretty fast and (for mysql) AFAIR best practice to determine the row count of a table. Of course, doing this in postgres or mssql is rather inefficient.



  • @Juifeng said:

     I think that using SELECT count(*) ... in MySQL is actually pretty fast
    and (for mysql) AFAIR best practice to determine the row count of a table.

    But SELECT * is probably not. And I think you replied to the wrong post.



  •  How about SELECT TOP 1 * from <DB>... we're not trying to determine row amount but if there are any rows at all.



  • @Ren said:

     How about SELECT TOP 1 * from <DB>... we're not trying to determine row amount but if there are any rows at all.

    I prefer the DB return the strictly defined [0 | >0], rather than the "wtf is this then" [null | something]

    Selecting count is the better way.



  • @dhromed said:

    @Ren said:

     How about SELECT TOP 1 * from <DB>... we're not trying to determine row amount but if there are any rows at all.

    I prefer the DB return the strictly defined [0 | >0], rather than the "wtf is this then" [null | something]

    Selecting count is the better way.

    The problem with selecting count is that if you aren't using MySQL with MyISAM tables the database will have to check every single row in the table.  On a table with millions of rows, this can take a considerable amount of time.  Probably the best thing to do is a SELECT CASE or similar with a LIMIT 1 so that 0 is returned for no rows in the table and 1 is returned for any rows.  It is possible in most RDBMS to get an estimate of the number of rows in a table, but there is no standard, cross-database syntax for it that I know of.



  • @morbiuswilters said:

    if you aren't using MySQL with MyISAM tables the database will have to check every single row in the table.  On a table with millions of rows, this can take a considerable amount of time
     

    Education taken.



  • @Juifeng said:

    SELECT count() ... in postgres or mssql is rather inefficient.

    Wrong.

    I don't know about postgres, but in MSSQL, COUNT() results in the exact same query plan as COUNT(PrimaryKeyColumn), and has since SQL Server 2000.

    What is it with people on this site associating Microsoft with Windows 95, IE4, Office 97, SQL Server 7, and VB6?  These products are all over 10 years old.



  •  It might be a shitty dating website that nobody goes to, in which case this seems like a reasonable plan.



  • @Aaron said:

    @Juifeng said:

    SELECT count() ... in postgres or mssql is rather inefficient.

    Wrong.

    I don't know about postgres, but in MSSQL, COUNT() results in the exact same query plan as COUNT(PrimaryKeyColumn), and has since SQL Server 2000.

    What is it with people on this site associating Microsoft with Windows 95, IE4, Office 97, SQL Server 7, and VB6?  These products are all over 10 years old.

    I think he's referring to the fact that most RDBMS must count every row when doing a SELECT COUNT(*) which can take quite a long time (many minutes) if you have millions of rows.  The only exception I know of is MySQL with MyISAM tables.  I'm not positive about MSSQL, but I know Postgres counts every single row and it would be sensible for Oracle and MSSQL to do the same.



  • @morbiuswilters said:

    I think he's referring to the fact that most RDBMS must count every row when doing a SELECT COUNT() which can take quite a long time (many minutes) if you have millions of rows.  The only exception I know of is MySQL with MyISAM tables.  I'm not positive about MSSQL, but I know Postgres counts every single row and it would be sensible for Oracle and MSSQL to do the same.

     

    MSSQL performs an index scan, which I guess is pretty slow - around 5-10 minutes for half a billion rows depending on hardware.  But I read that post as being about the difference between COUNT() and COUNT(SomeColumn) on those platforms that DBAs have been yapping about for years, apparently not realizing that there is no difference anymore (except in mysql).

    Efficiency is a relative term; the only other way to get a row count is to query the metadata (sys.dm_db_partition_stats), so it's kind of a moot point.

    And even then, why would you need to get a row count?  The original post was about determining whether or not there are rows in a table.  Taking a row count just to determine emptiness is almost as rookie as doing a SELECT *.  That's what TOP and EXISTS are for.



  • @Aaron said:

    But I read that post as being about the difference between COUNT() and COUNT(SomeColumn) on those platforms that DBAs have been yapping about for years, apparently not realizing that there is no difference anymore (except in mysql).

    That didn't even occur to me.  Given his statement about MySQL, I figured he was referring to the fact that MyISAM tables simply store the row count as metadata that can be returned instantly but that other table types in MySQL and other RDBMS actually count each row individually to return the row count.

     

    @Aaron said:

    Efficiency is a relative term; the only other way to get a row count is to query the metadata (sys.dm_db_partition_stats), so it's kind of a moot point.

    Right, which is the non-standard way I mentioned that works across most RDBMS.  Of course, it's just an estimate (usually tabulated at the time of the last ANALYZE which hopefully was not too far off) but sometimes that's good enough.

     

    @Aaron said:

    And even then, why would you need to get a row count?  The original post was about determining whether or not there are rows in a table.  Taking a row count just to determine emptiness is almost as rookie as doing a SELECT .  That's what TOP and EXISTS are for.

    I actually wasn't paying any attention to the context, I just jumped in to inform dhromed that doing SELECT COUNT() in any system other than MyISAM can potentially be slow.  I think a lot of people who use MySQL started on MyISAM and unfortunately SELECT COUNT() propagated as the way to determine row count (and hence emptiness) of a table since it returns quickly.  I agree that there are better ways.  Unfortunately, TOP is not supported by MySQL, Oracle or Postgres but EXISTS does, IIRC.



  •  I successfully completed the job in the time requested.

    Then I infected the requester with pig flu.



  • @morbiuswilters said:

    I agree that there are better ways.  Unfortunately, TOP is not supported by MySQL, Oracle or Postgres but EXISTS does, IIRC.
    MS T-SQL supports TOP.
    MySQL and PostgreSQL support LIMIT.
    Oracle supports none of these.



  • @TwelveBaud said:

    @morbiuswilters said:

    I agree that there are better ways.  Unfortunately, TOP is not supported by MySQL, Oracle or Postgres but EXISTS does, IIRC.
    MS T-SQL supports TOP.
    MySQL and PostgreSQL support LIMIT.
    Oracle supports none of these.

     

    Oracle has ROWNUM.  It's pretty unwieldy compared to TOP (i.e. doesn't work with ORDER BY), but if you just want to determine whether or not a table has rows or select a random row, it works.

    There's also the "standard", SET ROWCOUNT, which I think works on every product except Oracle.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.