corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Database searching (Split from 'I f**kin love CorsaSport')


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Database searching (Split from 'I f**kin love CorsaSport')
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 22:52   View User's Profile U2U Member Reply With Quote

Ian, change the search form post method to a GET pleeeeeeeease.

[Edited on 31-05-2005 by Ian]
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 22:54   View Garage View User's Profile U2U Member Reply With Quote

Just go to page 2 then alter the URL back to 1, thats all I did.

Would fix the reload crapism though.

I'll fix this whole thing when I re-write it. Its getting boolean soon.
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 22:56   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Ian
Just go to page 2 then alter the URL back to 1, thats all I did.

Would fix the reload crapism though.

I'll fix this whole thing when I re-write it. Its getting boolean soon.


Will it support logical operators and wildcards? What about the pesky 3-char minimum?
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:01   View Garage View User's Profile U2U Member Reply With Quote

Don't know we need to test that for speed. I hope so, its a pain. If not I'll program a workaround for searching for single short words.
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:03   View User's Profile U2U Member Reply With Quote

Maybe have a dictionary of "approved" terms.

"attention whore" and "agree with joff" could be compiled stored procs. to reduce overheads.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:05   View Garage View User's Profile U2U Member Reply With Quote

I'm removing Colin so the first query will be far quicker anyway.

There's no word list with the MySQL fulltext stuff but you can just alter the config to reduce to 2 char. Not sure quite what the impact will be on speed.
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:06   View User's Profile U2U Member Reply With Quote

I had a play with some indexes this weekend and managed to knock my execution times down to a third of what they used to be.
Maybe my queries were just badly written in the first place...
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
30th May 05 at 23:08   View User's Profile U2U Member Reply With Quote

Joffery do you the web development for Piper?
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:10   View Garage View User's Profile U2U Member Reply With Quote

Yeah the indexes certainly help. That IP logging stuff was like 16 seconds to group by over the whole post table and get the usernames of everyone who shares the address, but we indexed it and its down to just under a second. Still not fast enough for hundreds of concurrent but as its only mods who get that I can live with it.

The other choice is the way VB does it which is to build another table with words in, and a further table which links your word table with post many to many. Complex queries but the record count is far lower so although its a join its far less lookups.
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:11   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by James
Joffery do you the web development for Piper?


Pipercross, yes.
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
30th May 05 at 23:12   View User's Profile U2U Member Reply With Quote

Has anyone had any experience with C#.Net? I will be learning it when I start my work placement in a fortnight
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:15   View User's Profile U2U Member Reply With Quote

That's the way I've done it (VB) - I've got an intermediary table which is just a list of id's.
Still not sure if it's needed for how I'm using it, but it's working so...
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:15   View Garage View User's Profile U2U Member Reply With Quote

I have a friend writes C# for Morgan Stanley. Never touched it myself.
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
30th May 05 at 23:16   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Ian
I have a friend writes C# for Morgan Stanley. Never touched it myself.


Must be a financial thing, i'm working for Barclays
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:16   View User's Profile U2U Member Reply With Quote

Started VB.Net, wished I'd gone the C# route, then left that job and haven't done anything since.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:17   View Garage View User's Profile U2U Member Reply With Quote

What you searching through and how many records?

I'm sure you can speed things up using substring and not WHERE LIKE as well.
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:18   View User's Profile U2U Member Reply With Quote

I'm surprised financial services are going the .Net route.
I'd have thought on critical apps like that, it would be better to stick to tried and tested technologies rather than pay someone that's "been on a course" three times as much.
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
30th May 05 at 23:19   View User's Profile U2U Member Reply With Quote

its not really critical, i'll be developing the intranet for their human resources department
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:20   View Garage View User's Profile U2U Member Reply With Quote

They were using Java for a bit and I'm sure Tim uses that at Deutsche.
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:20   View User's Profile U2U Member Reply With Quote

Lots of free text.

Table 1: 19774 rows
Table 2: 24741

Other tables have yet to be populated, lots of one-many relationships to given.

Searches are on LIKE terms atm... substring you say?
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:22   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Joff
substring you say?
Yeah for the same reason that substr() is faster than regular expression pattern matching. No idea why but it might be worth investigating if its supported in your connection method (ODBC?)
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:27   View User's Profile U2U Member Reply With Quote

Yeah, ASP DSN-less ODBC.

Not sure substring is what I'm after tbh, do you mean the mySQL substring function or some PHP gheyness?
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:30   View Garage View User's Profile U2U Member Reply With Quote

Its like a pre-query, select the records where there's a substring and you just return a load of 1s, then run the query again and go get the text but this time its a WHERE id=something rather than a match which is less efficient.

Not even sure if you can do it with ODBC, I'm sure select is not particularly well specced unless you start messing about improving it.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
30th May 05 at 23:32   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Ian
Its like a pre-query blah blah
And furthermore I'm not even sure it would speed you up on so few records.

[Edited on 30-05-2005 by Ian]
Joff
Member

Registered: 17th Oct 00
Location: Cambridgeshire
User status: Offline
30th May 05 at 23:34   View User's Profile U2U Member Reply With Quote

Nope, not an option (AFAIK) and not something that would help.

Tbh, execution time's not a problem as it is, it's only a client wanting to search on more or less every field, with one or more fields included, which the app is designed to do.


 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » Database searching (Split from 'I f**kin love CorsaSport') 23 database queries in 0.0233588 seconds