Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(at': 0.04; 'say,': 0.05; 'subject:number': 0.09; 'sure,': 0.09; 'api': 0.11; 'cc:addr :python-list': 0.11; 'command,': 0.16; 'extension.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'instance:': 0.16; 'provision': 0.16; 'rewriting': 0.16; 'roy': 0.16; 'specifying': 0.16; 'statement.': 0.16; 'index': 0.16; 'all.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'select': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'specifies': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'external': 0.29; 'am,': 0.29; "doesn't": 0.30; 'statement': 0.30; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; 'program,': 0.31; '13,': 0.31; 'contrast,': 0.31; 'call.': 0.33; 'subject:the': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'changing': 0.37; 'turn': 0.37; 'performance': 0.37; 'sometimes': 0.38; 'itself': 0.39; 'how': 0.40; 'even': 0.60; 'most': 0.60; 'matter': 0.61; 'course': 0.61; 'simply': 0.61; 'our': 0.64; 'taking': 0.65; 'smith': 0.68; 'article': 0.77; 'subject:get': 0.81; '11:45': 0.84; 'improvement': 0.84; '"how': 0.91; 'can!': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=0Pz5DktL/0XQNmt3GDvnar2rbK+qv8oAEPRUp4BN3mw=; b=wIDd9bKKTagT0+SDRUI9sS6B5Jw8V0OmcOe4yDAeL/YK46yReXaX9Y37hfPgcR7OAZ R0Eaaq67nna+Crs4kVA1f8JAeALz79V/0R6o+/cmynFQSX/IIdqUbAQbSDz7O1eFe9i7 c8GMlfuFip1XVv2IDSPiYZ7FAFEWjCEYfTvPDaOePO1iFzBUC7duh1QBSA/r2zin7JxK 9ZW14/zmru1Onsm8iI13yKipFhABLlabhmBa9QyzPAvQRBKz+yb3HKbUMzeegSXDZWZt FHJw8RvsP7/iHI+QZEDjhkhPV420JewFnlC34szJeEdVrCaYjm3w7NICbOCx949SvjwU 2X2Q== MIME-Version: 1.0 X-Received: by 10.42.101.77 with SMTP id d13mr2763588ico.53.1407895600227; Tue, 12 Aug 2014 19:06:40 -0700 (PDT) In-Reply-To: References: <53E658CD.5020904@gmail.com> <53e59035$0$29998$c3e8da3$5496439d@news.astraweb.com> <338e8fb0-c9ec-462a-b560-1c1ff77de17e@googlegroups.com> <154cc342-7f85-4d16-b636-a1a953913c98@googlegroups.com> <8c41d779-0c26-430a-a915-08c2b962e0e7@googlegroups.com> <53e89063$0$29890$c3e8da3$5496439d@news.astraweb.com> <53eab595$0$9505$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 13 Aug 2014 12:06:40 +1000 Subject: Re: how to get the ordinal number in list From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407895602 news.xs4all.nl 2839 [2001:888:2000:d::a6]:34399 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76164 On Wed, Aug 13, 2014 at 11:45 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> I like to look at SQL as a language that specifies an end result >> without specifying how to get there > > Well, sure, but sometimes the how to get there is a matter of 10x, or > 100x, or 1000x in performance. Of course it can! But generally, the "how to get there" is not stipulated in the SQL statement. If you say, for instance: select * from some_table where some_column='some_value'; then an index on some_column will make a huge difference to performance - without changing this statement at all. In contrast, taking advantage of an index in BTrieve requires recoding your program, as the index used is a part of the API call. (At least, this is true of the particular version of BTrieve that back-ended our accounting package in the 90s. I was able to turn an overnight job into a thirty-second job by rewriting it as an external program; the original is closed-source so I can't be sure, but I suspect most of that improvement is simply because I used an index.) SQL itself doesn't even have provision for indexes. The 'CREATE INDEX' command, found in many databases, is an extension. :) ChrisA