pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
techniques for manual ordering of data ?
3+ messages / 3 participants
[nested] [flat]

* techniques for manual ordering of data ?
@ 2004-02-07 10:47 Peter Galbavy <peter.galbavy@knowtion.net>
  2004-02-09 17:00 ` Re: techniques for manual ordering of data ? scott.marlowe <scott.marlowe@ihs.com>
  2004-05-08 16:36 ` Re: techniques for manual ordering of data ? Bruno Wolff III <bruno@wolff.to>
  0 siblings, 2 replies; 3+ messages in thread

From: Peter Galbavy @ 2004-02-07 10:47 UTC (permalink / raw)
  To: pgsql-sql

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.

rgds,
--
Peter




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: techniques for manual ordering of data ?
  2004-02-07 10:47 techniques for manual ordering of data ? Peter Galbavy <peter.galbavy@knowtion.net>
@ 2004-02-09 17:00 ` scott.marlowe <scott.marlowe@ihs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: scott.marlowe @ 2004-02-09 17:00 UTC (permalink / raw)
  To: Peter Galbavy <peter.galbavy@knowtion.net>; +Cc: pgsql-sql

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.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: techniques for manual ordering of data ?
  2004-02-07 10:47 techniques for manual ordering of data ? Peter Galbavy <peter.galbavy@knowtion.net>
@ 2004-05-08 16:36 ` Bruno Wolff III <bruno@wolff.to>
  1 sibling, 0 replies; 3+ messages in thread

From: Bruno Wolff III @ 2004-05-08 16:36 UTC (permalink / raw)
  To: Peter Galbavy <peter.galbavy@knowtion.net>; +Cc: pgsql-sql

On Sat, Feb 07, 2004 at 10:47:37 -0000,
  Peter Galbavy <peter.galbavy@knowtion.net> wrote:
> 
> 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.

Numeric might be better for this than int, since you can keep subdividing
without having to renumber. If you hide the real numbers from the users,
you might not ever need to do a bulk renumber.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-05-08 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-07 10:47 techniques for manual ordering of data ? Peter Galbavy <peter.galbavy@knowtion.net>
2004-02-09 17:00 ` scott.marlowe <scott.marlowe@ihs.com>
2004-05-08 16:36 ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox