Re: How do I bump a row to the front of sort efficiently

From: BladeOfLight16 <bladeoflight16(at)gmail(dot)com>
To: Sam Saffron <sam(dot)saffron(at)gmail(dot)com>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How do I bump a row to the front of sort efficiently
Date: 2015-02-04 02:34:38
Message-ID: CA+=1U=UyWymmhaD6sgUE8ubu=ws7XiUnfF_WB7mS5+sCKmYsDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Feb 3, 2015 at 9:33 PM, BladeOfLight16 <bladeoflight16(at)gmail(dot)com>
wrote:

> This is why ORMs are bad. They make hard problems *much* harder, and the
> only benefit is that they maybe make easy problems a little quicker. The
> cost/savings is *heavily* skewed toward the cost, since there's no upper
> bound on the cost and there is a pretty small lower bound on the savings.
> Micro-ORMs tend to do a better job of not shielding you from (or rather,
> getting in the way of) the SQL while still providing some good
> result-to-object translation. Whether even that is necessary depends on
> your language, though. (For example, in Python, psycopg2 has a built in way
> of spitting out namedtuples, which means you get result-to-object
> translation out of the box. That makes even a micro-ORM pretty unnecessary.
> On the other hand, a micro-ORM that does this well without blocking you
> from the SQL, such as PetaPOCO, is a boon in .NET.)
>
> If you can, your best bet would probably be to find a way to get your ORM
> to execute raw SQL (with good parametrization to prevent injection
> attacks!!!!) and be done with it. It took me way too much experience
> fighting with an ORM on complicated queries to realize that.
>

Er, *pretty small upper bound on the savings.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Saffron 2015-02-04 04:28:51 Re: How do I bump a row to the front of sort efficiently
Previous Message BladeOfLight16 2015-02-04 02:33:36 Re: [GENERAL] How do I bump a row to the front of sort efficiently

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-02-04 03:12:35 pg_dump's aborted transactions
Previous Message BladeOfLight16 2015-02-04 02:33:36 Re: [GENERAL] How do I bump a row to the front of sort efficiently