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
Shaggar
Apr 26, 2006
write a proc w/ all the possible search parameters. make them optional parameters

write a big ol' select w/ a pile of left joins to the tables containing the criteria.
in ur where clause (or in the joins) filter on (leftJoinedTable.criteria=@searchCriteria || @searchCriteria is null) this way if the criteria is given, you search on it otherwise you ignore it.

weight the results in the order by

option (recompile) to prevent it from optimizing the proc w/ the first set of parameters entered.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
altho that search will return only things that match. if you want to weight on match count then its probably gonna be gross

Bloody
Mar 3, 2013

i have a .net console app that i want to minimize to the system tray rather than the taskbar how do i do this

i vaguely recall a tiny vb script that would wrap an app and minimize it to tray but i have no idea how to do that and im not getting useful search results

Shaggar
Apr 26, 2006
console applications don't have windows so they cant be minimized to the tray. the command prompt also cant be minimized to the tray afaik so if you launch it there you get the normal command prompt window.

idk if maybe you could use vbscript to launch the thing in a command prompt and then put it in a tray from there somehow.

the correct way to do this is to use a windowed application. use wpf if you do this.

if this is a short running application, then leaving it in the taskbar is appropriate because the user should be aware of what its doing.
if this is a long running application, do the wpf thing and minimize to the tray.
if this thing is always running and is non-interactive other than start/stop then make it a windows service.

CISADMIN PRIVILEGE
Aug 15, 2004

optimized multichannel
campaigns to drive
demand and increase
brand engagement
across web, mobile,
and social touchpoints,
bitch!
:yaycloud::smithcloud:

Shaggar posted:

write a proc w/ all the possible search parameters. make them optional parameters

write a big ol' select w/ a pile of left joins to the tables containing the criteria.
in ur where clause (or in the joins) filter on (leftJoinedTable.criteria=@searchCriteria || @searchCriteria is null) this way if the criteria is given, you search on it otherwise you ignore it.

weight the results in the order by

option (recompile) to prevent it from optimizing the proc w/ the first set of parameters entered.

This is basically what I want, but how terribly will that perform? Will magical background optimization mean it actually works relatively well?

Performance wise would I be better off just converting any that is textable to text and having a big search text field (It would be 2K chars max) then searching that using full text search with relevancy?


Shaggar posted:

altho that search will return only things that match. if you want to weight on match count then its probably gonna be gross

fortunately match count won't be an issue, in fact we specifically wouldn't want that.

Shaggar
Apr 26, 2006
The performance will be as good as your indexes which really means its as good as your data. If you have good id values for the criteria then use them. Have the ui display the text value, but when it submits the search it should submit your ids to the search proc. for the text fields you have to search obviously you cant do that, but the goal is to minimize text search.

option recompile actually disables optimization and there is a reason for it. Normally when you run a proc your parameters aren't optional so sql server can optimize your query based on known possible input parameters. It will try to do this with your search proc if you let it and it will optimize based on the first parameters passed in. so if some of the optional parameters arent set (meaning they're null) it will optimize and compile the query with that in mind which will cause performance problems when the value is passed in. option recompile tells sql server to recompile it every time. this is a pretty big no-no almost everywhere else but this is like the one textbook example of why the option exists.

for the text search you should limit it to text only fields like product name or product description or w/e. If product has a color field and that field is an id that references a table of possible colors, that should be in a drop down or other similar id based input. you can use this as an excuse to not include color in the text you're searching which will make it faster. (if that makes sense?)
then for the actual search you could do what you're suggesting, but my guess is the concatenation of multiple fields would be really slow unless you're planning on doing it in a materialized view or into another table. idk if sql full text search works across fields, but tbh I've never actually used it. the text search is gonna be a pain and the source of all your performance problems.

Shaggar
Apr 26, 2006
also get more ram. stick all the ram you can into that machine and sql server will eventually decide to just store as much of your tables up in there as possible which is gr8.

Bloody
Mar 3, 2013

Shaggar posted:

console applications don't have windows so they cant be minimized to the tray. the command prompt also cant be minimized to the tray afaik so if you launch it there you get the normal command prompt window.

idk if maybe you could use vbscript to launch the thing in a command prompt and then put it in a tray from there somehow.

the correct way to do this is to use a windowed application. use wpf if you do this.

if this is a short running application, then leaving it in the taskbar is appropriate because the user should be aware of what its doing.
if this is a long running application, do the wpf thing and minimize to the tray.
if this thing is always running and is non-interactive other than start/stop then make it a windows service.

yeah i should convert it to a service how annoying is that

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

also get more ram. stick all the ram you can into that machine and sql server will eventually decide to just store as much of your tables up in there as possible which is gr8.

this is always good advice

ram and servers are cheaper than exotic distributed database systems up until your database is several terabytes

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer

Bloody posted:

yeah i should convert it to a service how annoying is that

topshelf-project.com

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

this is always good advice

ram and servers are cheaper than exotic distributed database systems up until your database is several terabytes

unless you're storing blobs of things but you probably shouldn't be keeping blobs of things in databases

Shaggar
Apr 26, 2006
you can stick ur blobs in slow disk and keep it out of ram if you really need it. the only time I'd use a blob is if you have some document that isn't relevant outside of the context of the related data in the database.

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer
does anyone really have any fun doing database poo poo? i mean ugh

tef
May 30, 2004

-> some l-system crap ->
yep

Shaggar
Apr 26, 2006
yeah. feels good, man

Shaggar
Apr 26, 2006
unghhhh hekaton....

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Pandora Nominations


Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Nam dui mi, accumsan porttitor, facilisis luctus, metus!

looks grate

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer
like is it some cuckold fetish thing or what

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
databases are the only time i get to feel at all normalized

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

ChiralCondensate posted:

does anyone really have any fun doing database poo poo? i mean ugh

I used to hate dealing with databases (phpMyAdmin unnerved me) but I think I like them fine nowadays. hail codd

more like dICK
Feb 15, 2010

This is inevitable.
lol if you don't love normalizing data

more like dICK
Feb 15, 2010

This is inevitable.

Shaggar
Apr 26, 2006

idk why you'd use this instead of just writing a normal .net service but w/e

Shaggar
Apr 26, 2006

Symbolic Butt posted:

I used to hate dealing with databases (phpMyAdmin unnerved me) but I think I like them fine nowadays. hail codd

MySQL is not a database

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

ChiralCondensate posted:

like is it some cuckold fetish thing or what

nice av

jony neuemonic
Nov 13, 2009

ChiralCondensate posted:

does anyone really have any fun doing database poo poo? i mean ugh

yes, unless the schema is completely hosed. like the one i deal with at work every day. hoo boy.

AWWNAW
Dec 30, 2008

Shaggar posted:

idk why you'd use this instead of just writing a normal .net service but w/e

it's a console app and self installing windows service in one build, I don't know why you wouldn't use it

Shaggar
Apr 26, 2006
you can do that w/ a normal windows service.

Corla Plankun
May 8, 2007

improve the lives of everyone
what is the appropriate response to your boss emailing you a list at 4 o'clock on thursday containing 5 complicated things to have done by friday?

i can only use the woops i forgot to send/recv my email excuse so many times before it starts to seem suspect

b0lt
Apr 29, 2005

Corla Plankun posted:

what is the appropriate response to your boss emailing you a list at 4 o'clock on thursday containing 5 complicated things to have done by friday?

i can only use the woops i forgot to send/recv my email excuse so many times before it starts to seem suspect

[img-goatse]

Stringent
Dec 22, 2004


image text goes here

Corla Plankun posted:

what is the appropriate response to your boss emailing you a list at 4 o'clock on thursday containing 5 complicated things to have done by friday?

i can only use the woops i forgot to send/recv my email excuse so many times before it starts to seem suspect

look for a new job?

Stringent
Dec 22, 2004


image text goes here
alternatively you could talk with your boss and explain your situation, but iunno about your circumstances

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

ChiralCondensate posted:

does anyone really have any fun doing database poo poo? i mean ugh

MongoDB is pretty fun and I suspect you could do some pretty wacky things with Cassandra DB if you can wrap your head around how to model your data.

Dirk Pitt
Sep 14, 2007

haha yes, this feels good

Toilet Rascal

Corla Plankun posted:

what is the appropriate response to your boss emailing you a list at 4 o'clock on thursday containing 5 complicated things to have done by friday?

i can only use the woops i forgot to send/recv my email excuse so many times before it starts to seem suspect

time to update the old resume.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

ChiralCondensate posted:

does anyone really have any fun doing database poo poo? i mean ugh

properly-normalized data makes my autism tingle in a pleasant way :feelsgood:

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

syntaxrigger posted:

MongoDB is pretty fun and I suspect you could do some pretty wacky things with Cassandra DB if you can wrap your head around how to model your data.

mongodb is fun because it's made for clowns

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Symbolic Butt posted:

mongodb is fun because it's made for clowns

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Bloody posted:

i have a .net console app that i want to minimize to the system tray rather than the taskbar how do i do this

i vaguely recall a tiny vb script that would wrap an app and minimize it to tray but i have no idea how to do that and im not getting useful search results

if you don't care about windows <= vista/server 2008, you can use GetConsoleWindow to get the handle to the window, and hook it to detect when it gets minimized (see SetWindowsHookEx; you'll need a hook DLL and a hook that can catch the minimize event; WH_CBT is a good one and will send you HCBT_MINMAX events). then you can hide it and add your tray icon. this is by far the simplest way, not necessarily the best

if you do care about windows vista and earlier, it's more complicated because in those versions console windows are managed by a system process and there is a limited amount of fuckery possible (in case of vista, next to none)

hackbunny fucked around with this message at 15:54 on Oct 17, 2014

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Symbolic Butt posted:

mongodb is fun because it's made for clowns

Meh it has its uses like anything else.

Lol if you think SQL is the only viable storage solution

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
it is if you care about the data

  • Locked thread