pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Replace insertion sort in contrib/intarray with qsort().
6+ messages / 1 participants
[nested] [flat]

* pgsql: Replace insertion sort in contrib/intarray with qsort().
@ 2015-03-16 03:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-16 03:22 UTC (permalink / raw)
  To: pgsql-committers

Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/40b0c10b763dfe4d6b171a58a2bd49cc3f880087

Modified Files
--------------
contrib/intarray/_int_tool.c |   51 +++++++++++++++++++++---------------------
1 file changed, 25 insertions(+), 26 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Replace insertion sort in contrib/intarray with qsort().
@ 2015-03-16 03:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-16 03:22 UTC (permalink / raw)
  To: pgsql-committers

Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/83587a075dd1d6380de24f16df85bf629689effc

Modified Files
--------------
contrib/intarray/_int_tool.c |   52 +++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 29 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Replace insertion sort in contrib/intarray with qsort().
@ 2015-03-16 03:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-16 03:22 UTC (permalink / raw)
  To: pgsql-committers

Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8582ae7aabbefa1b99c2d42266de1b026fa06cc7

Modified Files
--------------
contrib/intarray/_int_tool.c |   52 +++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 29 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Replace insertion sort in contrib/intarray with qsort().
@ 2015-03-16 03:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-16 03:22 UTC (permalink / raw)
  To: pgsql-committers

Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/904e8b627c2547e93112080aac9381bbf39e8e99

Modified Files
--------------
contrib/intarray/_int_tool.c |   52 +++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 29 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Replace insertion sort in contrib/intarray with qsort().
@ 2015-03-16 03:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-16 03:22 UTC (permalink / raw)
  To: pgsql-committers

Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8d1f239003d0245dda636dfa6cf0add13bee69d6

Modified Files
--------------
contrib/intarray/_int_tool.c |   52 +++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 29 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Replace insertion sort in contrib/intarray with qsort().
@ 2015-03-16 03:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-03-16 03:22 UTC (permalink / raw)
  To: pgsql-committers

Replace insertion sort in contrib/intarray with qsort().

It's all very well to claim that a simplistic sort is fast in easy
cases, but O(N^2) in the worst case is not good ... especially if the
worst case is as easy to hit as "descending order input".  Replace that
bit with our standard qsort.

Per bug #12866 from Maksym Boguk.  Back-patch to all active branches.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9288645b596efde3a58e267896b38f8f089a2920

Modified Files
--------------
contrib/intarray/_int_tool.c |   52 +++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 29 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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


end of thread, other threads:[~2015-03-16 03:22 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 03:22 pgsql: Replace insertion sort in contrib/intarray with qsort(). Tom Lane <tgl@sss.pgh.pa.us>
2015-03-16 03:22 pgsql: Replace insertion sort in contrib/intarray with qsort(). Tom Lane <tgl@sss.pgh.pa.us>
2015-03-16 03:22 pgsql: Replace insertion sort in contrib/intarray with qsort(). Tom Lane <tgl@sss.pgh.pa.us>
2015-03-16 03:22 pgsql: Replace insertion sort in contrib/intarray with qsort(). Tom Lane <tgl@sss.pgh.pa.us>
2015-03-16 03:22 pgsql: Replace insertion sort in contrib/intarray with qsort(). Tom Lane <tgl@sss.pgh.pa.us>
2015-03-16 03:22 pgsql: Replace insertion sort in contrib/intarray with qsort(). Tom Lane <tgl@sss.pgh.pa.us>

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