Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
akadajet
Sep 14, 2003

most sql databases are actually good. at least when you compare with the nosql competition

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

tef posted:

schemas and migrations are great when you can do them without downtime

backfilling is pretty much what always happens in practice anyhow with live data

and you end up resolving the ambiguity in the application, as ever

yeah that's why I'm that thing

Stereotype
Apr 24, 2010

College Slice
I really don't want to have to learn SQL but I bet I will have to at some point.

Shaggar
Apr 26, 2006
sql is great.

JewKiller 3000
Nov 28, 2006

by Lowtax

tef posted:

here's a database riddle: how do you do PRODUCT(column), i.e c1*c2*c3*c4...

code:
postgres=# create aggregate product(numeric) (sfunc = numeric_mul, stype = numeric);
CREATE AGGREGATE
postgres=# \timing on
Timing is on.
postgres=# select product(n) from generate_series(1, 100) as n;
                                                                            product                                                                             
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
(1 row)

Time: 2.447 ms
:confused:

tef
May 30, 2004

-> some l-system crap ->
nice

the old fashioned way is to do exp(sum(log(col))) :toot:

JewKiller 3000
Nov 28, 2006

by Lowtax
hahahaha oh man i never would have thought of that, and if i saw it in existing code i wouldn't have understood the purpose either. it's perfect

JewKiller 3000
Nov 28, 2006

by Lowtax
"but jewkiller, you racist gently caress, surely it must also be easy to make a custom aggregate function in oracle to do products, right?" you bet!

http://radino.eu/2010/11/17/product-aggregate-function/ posted:

code:
CREATE OR REPLACE TYPE product_impl AS OBJECT
(
product NUMBER,
 
STATIC FUNCTION ODCIAggregateInitialize(ctx IN OUT product_impl) RETURN NUMBER,
 
MEMBER FUNCTION ODCIAggregateIterate(SELF  IN OUT product_impl,
VALUE IN NUMBER) RETURN NUMBER,
 
MEMBER FUNCTION ODCIAggregateMerge(SELF IN OUT product_impl,
ctx2 IN product_impl) RETURN NUMBER,
 
MEMBER FUNCTION ODCIAggregateTerminate(SELF        IN OUT product_impl,
returnvalue OUT NUMBER,
flags       IN NUMBER) RETURN NUMBER
)
/
 
CREATE OR REPLACE TYPE BODY product_impl IS
STATIC FUNCTION ODCIAggregateInitialize(ctx IN OUT product_impl) RETURN NUMBER IS
BEGIN
ctx := product_impl(1);
RETURN ODCIConst.Success;
END ODCIAggregateInitialize;
 
MEMBER FUNCTION ODCIAggregateIterate(SELF  IN OUT product_impl,
VALUE IN NUMBER) RETURN NUMBER IS
BEGIN
IF VALUE IS NOT NULL THEN
SELF.product := SELF.product * VALUE;
END IF;
RETURN ODCIConst.Success;
END ODCIAggregateIterate;
 
MEMBER FUNCTION ODCIAggregateMerge(SELF IN OUT product_impl,
ctx2 IN product_impl) RETURN NUMBER IS
BEGIN
SELF.product := SELF.product * ctx2.product;
RETURN ODCIConst.Success;
END ODCIAggregateMerge;
 
MEMBER FUNCTION ODCIAggregateTerminate(SELF        IN OUT product_impl,
returnvalue OUT NUMBER,
flags       IN NUMBER) RETURN NUMBER IS
BEGIN
returnvalue := SELF.product;
RETURN ODCIConst.Success;
END ODCIAggregateTerminate;
END;
/
 
CREATE OR REPLACE FUNCTION product(x IN NUMBER) RETURN NUMBER
PARALLEL_ENABLE
AGGREGATE USING product_impl;
/
 
DROP TABLE prod_test;
 
CREATE TABLE prod_test(val number);
 
INSERT INTO prod_test VALUES (1);
 
INSERT INTO prod_test VALUES (2);
 
INSERT INTO prod_test VALUES (3);
 
INSERT INTO prod_test VALUES (4);
 
COMMIT;
 
SELECT product(val) FROM prod_test;
 
PRODUCT(VAL)
------------
24

ENTERPRISE! :captainpop:

SpaceAceJase
Nov 8, 2008

and you
have proved
to be...

a real shitty poster,
and a real james

qhat posted:

for example

Debian mysql stack

cowboy beepboop
Feb 24, 2001

SpaceAceJase posted:

Debian mysql stack

don't even say mysql is good tia

SpaceAceJase
Nov 8, 2008

and you
have proved
to be...

a real shitty poster,
and a real james

my stepdads beer posted:

don't even say mysql is good tia

the attention i crave

akadajet
Sep 14, 2003

id just go with postgres and centos if i needed a sql

akadajet
Sep 14, 2003

if i needed a full text search to go with it id probably throw in elastic

JewKiller 3000
Nov 28, 2006

by Lowtax
elasticsearch is more powerful, but postgres full text search is often good enough, and then you don't have to maintain a separate search engine

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

JewKiller 3000 posted:

"but jewkiller, you racist gently caress, surely it must also be easy to make a custom aggregate function in oracle to do products, right?" you bet!


ENTERPRISE! :captainpop:

i've been reliably informed that you picked the dumbest possible way to illustrate this

JewKiller 3000
Nov 28, 2006

by Lowtax
go ahead then, show me the nice easy way to make a custom aggregate in oracle

i mean that's practically straight out of the manual so idk how reliable your informant is

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
hey, i didn't read any of this and i'm not going to. just wanted to say that mariadb is really good, but if you can't use that plain old mysql is just fine

JewKiller 3000
Nov 28, 2006

by Lowtax
many thanks, tiny bug idiot, for blindly contributing your awful phpinions to yet another thread. your gimmick is truly always appreciated

qhat
Jul 6, 2015


i've only ever implemented a non-trivial mysql production database once and that was and will be the last time

qhat
Jul 6, 2015


it's un loving believable the amount of hoops you have to jump through to get that DB to work well enough to be considered production ready. but hey i guess if you hate stored procedures and replication because you see those features as just unnecessary and for spergs only, then go loving nuts

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

sproc out with you're cock out

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Tiny Bug Child posted:

hey, i didn't read any of this and i'm not going to. just wanted to say that mariadb is really good, but if you can't use that plain old mysql is just fine

Don't you outsource your db poo poo to some webhost anyway

cowboy beepboop
Feb 24, 2001

qhat posted:

it's un loving believable the amount of hoops you have to jump through to get that DB to work well enough to be considered production ready. but hey i guess if you hate stored procedures and replication because you see those features as just unnecessary and for spergs only, then go loving nuts

isn't it just?? getting a slave up on a large existing database is a huge pain in the dick that involves special percona perl tools that barely work and non trivial amounts of downtime due to needing a long global lock on the master. or even more downtime if you do it hte official way and shutdown the master and rsync the data the slave

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


what i learned recently is that text indexes on mssql (all sql maybe?) are basically only starts with or ends with otherwise everything is just a scan so %mystring% is always a scan, who knew?

when i did some "optimisation" by adding indexes to common columns i foudn this out because i created a query plan that was 50/50 as to whether it would ultra gently caress the query processor into doing 2 million read ops for a regular query or 10 read ops, can you guess which version ran in testing vs. production?

Salt Fish
Sep 11, 2003

Cybernetic Crumb

my stepdads beer posted:

isn't it just?? getting a slave up on a large existing database is a huge pain in the dick that involves special percona perl tools that barely work and non trivial amounts of downtime due to needing a long global lock on the master. or even more downtime if you do it hte official way and shutdown the master and rsync the data the slave

Started a new slave today with 300Gb of MySQL data using Percona xtrabackup and it worked great with no downtime. Recommended 10/10 tool.

cowboy beepboop
Feb 24, 2001

300gb. bless.

akadajet
Sep 14, 2003

JewKiller 3000 posted:

elasticsearch is more powerful, but postgres full text search is often good enough, and then you don't have to maintain a separate search engine

oh that's nice

akadajet
Sep 14, 2003


that's a lot of butts

tef
May 30, 2004

-> some l-system crap ->
should i make a database paper effort post with some of the random poo poo i've been reading?


http://www.msr-waypoint.com/pubs/178758/bw-tree-icde2013-final.pdf
http://db.disi.unitn.eu/pages/VLDBProgram/pdf/research/p853-levandoski.pdf

like this pair, bw-tree and llama log strructured storage

or these old ones

http://daslab.seas.harvard.edu/reading-group/papers/kung.pdf
http://csis.pace.edu/~marchese/CS865/Papers/p180-thomas.pdf

Share Bear
Apr 27, 2004

are you actually implementing your own database?

Maximum Leader
Dec 5, 2014

yes.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
no. i don't need more poo poo on my reading list

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

YeOldeButchere posted:

no. i don't need more poo poo on my reading list

if you don;t want to read teffort posts get the gently caress out of yospos forever

tef
May 30, 2004

-> some l-system crap ->

Share Bear posted:

are you actually implementing your own database?

i've pissed around with some mvcc toys and made a radix trie, but never really went into wal/recovery (the hard bit)

i'd like to for fun and to learn something but it is a lot of effort, but having a vague idea about that toy helps me find different papers to read

Share Bear
Apr 27, 2004

that's cool. the older papers are especially helpful for understanding what may be going on under the hood as well.

old papers also seem remarkably easier to read than the newer ones

tef
May 30, 2004

-> some l-system crap ->

Share Bear posted:

that's cool. the older papers are especially helpful for understanding what may be going on under the hood as well.

old papers also seem remarkably easier to read than the newer ones

a lot of the harder ideas in old papers are often more common today

a lot of the modern papers are very clever optimisations or applications of earlier principles

there's still some the other way around though, but in general the older it is the more likely you've been exposed to the harder concepts contained

and then it's down to deciphering the notation and jargon

tef
May 30, 2004

-> some l-system crap ->
that and time tends to make it easier to filter out the god awful ones b/c no-one cites them

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
time for me to shill for "Readings in Database Systems" which is pretty much a collection of classic or otherwise interesting db papers. it's pretty good

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Captain Foo posted:

read teffort posts

  • Locked thread