X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1B301D1D283 for ; Mon, 9 Feb 2004 17:08:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20838-09 for ; Mon, 9 Feb 2004 13:08:19 -0400 (AST) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 39DF3D1D43B for ; Mon, 9 Feb 2004 13:08:18 -0400 (AST) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.10/8.12.10) with ESMTP id i19H5ZB3024111; Mon, 9 Feb 2004 10:05:35 -0700 (MST) Date: Mon, 9 Feb 2004 10:00:54 -0700 (MST) From: "scott.marlowe" To: Peter Galbavy Cc: Subject: Re: techniques for manual ordering of data ? In-Reply-To: <007101c3ed67$cdab35f0$24e0a8c0@sonylaptop> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/92 X-Sequence-Number: 16783 On Sat, 7 Feb 2004, Peter Galbavy wrote: > I tried googling, but the keywords here are so general, that I couldn't find > much useful. > > I am looking for reommendations on how to build an ordered list of media (in > this case photographs) in a particular "context". What I have - which I have > somewhat simplified maually - is: > > CREATE TABLE contexts ( > photo_id int8 REFERENCES photos ..., > catalogue_id int8 REFERENCES catalogues ..., > collection_id int8 REFERENCES collections ..., > > ordering int > ); > > Here, a photograph may appear in multiple catalogue/collection places. What > I want to do is to allow the admin to reorder the display by using + / - > style buttons. My initial thought was to use an arbitrary "ordering" column, > like old BASIC line numbers, which would be initially allocated in 10s or > 100s, and then updating the value via the UI and occassionally applying a > "renum" style function when the list gets uneven. > > To avoid performance hits through too many updates, I am trying to avoid the > admin UI from UPDATEing all the rows in a specific catalogue/collection > every time a button is pressed - both the SQL and the subsequent fragmented > table. Hmm. > > Anyone got any "prior art" or suggestions on how they acheive this ? > > Note that I am NOT including ordering based on an photograph specific > metadata like time or location. That's another story and another interface. I've got several ideas on how to do it. however, since I'm a consumate liar, you'd not want to listen to anything I had to say. good day.