Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. We Don't Need No Stinkin Indexes

We Don't Need No Stinkin Indexes

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasehtmlsql-serversysadmin
13 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P PIEBALDconsult

    Indices! Indices! Dagnabit! :mad: :-D

    A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #3

    Yet you didn't point out the double negative. :rolleyes:

    [WikiLeaks Cablegate Cables]

    P 1 Reply Last reply
    0
    • A AspDotNetDev

      Yet you didn't point out the double negative. :rolleyes:

      [WikiLeaks Cablegate Cables]

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #4

      Ah, but as a native speaker of American I can tell when a double negative is actually reenforcing the negativity rather than negating the negativity.

      1 Reply Last reply
      0
      • A AspDotNetDev

        I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.

        [WikiLeaks Cablegate Cables]

        R Offline
        R Offline
        Robert Rohde
        wrote on last edited by
        #5

        I'm not very familiar with SQL Server but shouldn't the primary key always be indexed automatically? (at least this is true for Oracle databases)

        A 1 Reply Last reply
        0
        • R Robert Rohde

          I'm not very familiar with SQL Server but shouldn't the primary key always be indexed automatically? (at least this is true for Oracle databases)

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #6

          Yes, I believe creating a primary key will create an index automatically. However, it was only a primary key by reputation, not because somebody made it a primary key. :)

          [WikiLeaks Cablegate Cables]

          K 1 Reply Last reply
          0
          • A AspDotNetDev

            Yes, I believe creating a primary key will create an index automatically. However, it was only a primary key by reputation, not because somebody made it a primary key. :)

            [WikiLeaks Cablegate Cables]

            K Offline
            K Offline
            Keith Barrow
            wrote on last edited by
            #7

            AspDotNetDev wrote:

            However, it was only a primary key by reputation, not because somebody made it a primary ke

            Erm you have bigger problems than a lack of indices then, don't you :whistles:-)

            Sort of a cross between Lawrence of Arabia and Dilbert.[^]
            -Or-
            A Dead ringer for Kate Winslett[^]

            A 1 Reply Last reply
            0
            • K Keith Barrow

              AspDotNetDev wrote:

              However, it was only a primary key by reputation, not because somebody made it a primary ke

              Erm you have bigger problems than a lack of indices then, don't you :whistles:-)

              Sort of a cross between Lawrence of Arabia and Dilbert.[^]
              -Or-
              A Dead ringer for Kate Winslett[^]

              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #8

              Haha, so it would seem.

              [WikiLeaks Cablegate Cables]

              1 Reply Last reply
              0
              • A AspDotNetDev

                I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.

                [WikiLeaks Cablegate Cables]

                M Offline
                M Offline
                musefan
                wrote on last edited by
                #9

                I think the only clear solution is to take a step back from databases and go back to paper based systems. Much easier than adding a primary key, and will help create more jobs for the industry... WIN/WIN And, are you sure you didn't get fooled?

                I may or may not be responsible for my own actions

                R 1 Reply Last reply
                0
                • A AspDotNetDev

                  I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.

                  [WikiLeaks Cablegate Cables]

                  M Offline
                  M Offline
                  Marc A Brown
                  wrote on last edited by
                  #10

                  Big ouch. :~

                  1 Reply Last reply
                  0
                  • M musefan

                    I think the only clear solution is to take a step back from databases and go back to paper based systems. Much easier than adding a primary key, and will help create more jobs for the industry... WIN/WIN And, are you sure you didn't get fooled?

                    I may or may not be responsible for my own actions

                    R Offline
                    R Offline
                    RobCroll
                    wrote on last edited by
                    #11

                    Don't know about win/win but the thought of dumping 10,000 pieces of paper on a business analyst's desk does have some appeal.

                    "You get that on the big jobs."

                    1 Reply Last reply
                    0
                    • A AspDotNetDev

                      I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.

                      [WikiLeaks Cablegate Cables]

                      A Offline
                      A Offline
                      Arnie Teres
                      wrote on last edited by
                      #12

                      Whenever we need to evaluate a performance problem at a customer the first thing we do is look for a missing index. Usually, this is the result of a messed up database installation but sometimes the damn thing is just not there. This kind of problem, as shameful as it is, is actually quite common. I've seen this on tables with millions of rows - no performance problem there eh?

                      1 Reply Last reply
                      0
                      • A AspDotNetDev

                        I just came across the main table in the SQL Server database that stores info for my company's website. It has 170,000 records... and no indexes. :wtf: I have just remedied that by putting a clustered index on the primary key. I'll have to keep a look out for code that queries that table by fields other than the primary key... may need to add more indexes.

                        [WikiLeaks Cablegate Cables]

                        H Offline
                        H Offline
                        HaBiX
                        wrote on last edited by
                        #13

                        indexes are so 90's..

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups