pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Artz <mlartz@gmail.com>
To: Aaron Bono <postgresql@aranya.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Storing an ordered list
Date: Wed, 26 Jul 2006 20:09:27 -0400
Message-ID: <e9c163070607261709t6cab87d3h2445712f9303b26b@mail.gmail.com> (raw)
In-Reply-To: <bf05e51c0607260807y66e32751la86d9b2f42fae47e@mail.gmail.com>
References: <e9c163070607251958x2ef2a315w4204aa2f90e70bbe@mail.gmail.com>
	<bf05e51c0607260807y66e32751la86d9b2f42fae47e@mail.gmail.com>

On 7/26/06, Aaron Bono <postgresql@aranya.com> wrote:
> If you use the linked list, remember this: to reduce the updates you are
> going to need more code in the application as it will have to keep track of
> what to update and what to not update.  It will also be more difficult to
> order the items using SQL so your application may have to take on that
> burden.  As a result, your application will become more complicated and
> writing reports that use the ordering will become difficult.

Yeah, that was what I wanted to avoid.  I wasn't sure if there was a
common approach to this sort of problem.

> When I need something like this I go with your first approach, a simple
> order field.  Unless the user is reordering a small number of items in a
> very large list and doing it frequently, is there really a need to worry
> about the number of updates?  Are you worrying about a performance problem
> you will never have?

Perhaps it is unnecessary, however I wanted to start out with a decent
design that could scale if need be.  Also, I'd like to support
"real-time" reordering, i.e. the user won't have to click "save" ...
as soon as they drag the item to a new position the list is updated.



view thread (7+ messages)  latest in thread

Message-ID: <e9c163070607261709t6cab87d3h2445712f9303b26b@mail.gmail.com>
Permalink:  ../e9c163070607261709t6cab87d3h2445712f9303b26b@mail.gmail.com/
Also on:    postgresql.org/message-id/e9c163070607261709t6cab87d3h2445712f9303b26b@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mlartz@gmail.com, postgresql@aranya.com
  Subject: Re: Storing an ordered list
  In-Reply-To: <e9c163070607261709t6cab87d3h2445712f9303b26b@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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