database

Database model for saving random boolean expressions

I have expressions like this: (cat OR cats OR kitten OR kitty) AND (dog OR dogs) NOT (pigeon OR firefly) Anyone having idea how to make tables to save those? Before I got request for usage of brackets, I limited usage of operators to avoid ambiguous situations. So only ANDs and NOTs or only ORs and saved those in this manner: operat...

Can object oriented databases be a better option than a relational database with an ORM?

Just thinking that a relational db with an ORM is in many ways very similar to an object oriented database. My experience lies solely with RDMS with a hint of ORM, so it seems to me that object oriented databases are very similar but without the experience I can't say for sure. If you have used object oriented databases and ORMs can yo...

Php efficiency question --> Database call vs. File Write vs. Calling C++ executable

Hi, What I wish to achieve is - log all information about each and every visit to every page ofmy website (like ip address, browser, referring page, etc). Now this is easy to do. What I am interested is doing this in a way so as to cause minimum overhead (runtime) in the php scripts. What is the best approach for this efficiency-wise:...

Composite Primary and Cardinality

I have some questions on Composite Primary Keys and the cardinality of the columns. I searched the web, but did not find any definitive answer, so I am trying again. The questions are: Context: Large (50M - 500M rows) OLAP Prep tables, not NOSQL, not Columnar. MySQL and DB2 1) Does the order of keys in a PK matter? 2) If the cardinali...

Retrieving all objects in code upfront for performance reasons

How do you folks retrieve all objects in code upfront? I figure you can increase performance if you bundle all the model calls together? This makes for a bigger deal, especially if your DB cannot keep everything in memory def hitDBSeperately { get X users ...code get Y users... code get Z users... code } ...

Very large database, very small portion most being retrieved in real time

Hi folks, I have an interesting database problem. I have a DB that is 150GB in size. My memory buffer is 8GB. Most of my data is rarely being retrieved, or mainly being retrieved by backend processes. I would very much prefer to keep them around because some features require them. Some of it (namely some tables, and some identifiable ...

Is this Informix SE?

I have a group of files that have extensions of .dat & .idx. They seem to be named in pairs. These files were under a folder named deeds.dbs. How do I access this data? Sorry for the general question, but I know nothing about Informix at all. ...

How to find the entity with the greatest primary key?

I've an entity LearningUnit that has an int primary key. Actually, it has nothing more. Entity Concept has the following relationship with it: @ManyToOne @Size(min=1,max=7) private LearningUnit learningUnit; In a constructor of Concept I need to retrieve the LearningUnit with the greatest primary key. If no LearningUnit exists ...

select multiple columns using linq and sum them up

Hi, How can i select multiple columns and calculate the total amount. For example, in my database i got a few fields which are named: 5hunderedBills, 2hunderedBills, 1hunderedBills, etc. And the value of those fields are for example: 5, 2, 3 And the sum would be: 5hunderedBills * 5 + 2hunderedBills * 2 + 1hunderedBills * 3 How ca...

Storing cvs data for further manipulation using Ruby

I am dealing with a csv file that has some customer information (email, name, address, amount, [shopping_list: item 1, item 2]). I would like work with the data and produce some labels for printing... as well as to gather some extra information (total amounts, total items 1...) My main concern is to find the appropriate structure to st...

Select distinct users with referrals

I have a bunch of Users. Since Django doesn't really let me extend the default User model, they each have Profiles. The Profiles have a referred_by field (a FK to User). I'm trying to get a list of Users with >= 1 referral. Here's what I've got so far Profile.objects.filter(referred_by__isnull=False).values_list('referred_by', flat=Tr...

Is it normal to get SQLITE_BUSY on a read only database?

I have 2 processes: 1 is writing to a sqlite database, 1 is reading from the same database. Occasioally, I get SQLITE_BUSY on my selects. Is this normal? Is their some option or way I could open the database so that it blocks until it CAN complete the query? (I tried the FULLMUTEX option on the open call but it appeared to have no effect...

Best naming for a column in a SQL Server table

Which of the following three options would you choose for a column name in a SQL Server table, and why? YearToDateWages YTDWages YtdWages Follow up: SSN Ssn SocialSecurityNumber ...

Hosting an Access DB

Hey, So I'm inexperienced in hosting DB's and I've always had the luxury of someone else getting the db setup. I was going to help a friend out with getting a webpage setup, I've got experience in Asp.Net MVC so I'm going with that. They want to setup a search page to query a db and display the results. My question I have is in gettin...

Java Swing with database connection

Can anyone please help me on how to create a login form in java swing by using a database connection. ...

Problem with duplicates in a SQL Join

I have the following result set from a join of three tables, an articles table, a products table, an articles to products mapping table. I would like to have the results with duplicates removed similar to a select distinct on content id. Current result set: [ContendId] [Title] [productId] 1 article one 2 1 ...

asp.net mvc diff between DeleteAllOnSubmit and deleteonSubmit

What is the real difference b/w DeleteAllOnSubmit and deleteonSubmit and which one is more appropiate to use? ...

Free tool to watch database for changes?

Im looking for a tool that can watch database(mysql and oracle) for changes. When someone inserts or updates something in any(or chosen) table i want to get to know about it. It could be very useful for working with others people code that do some magic in database. I know that it can be done using triggers (see this question), but im ...

MS SQL - High performance data inserting with stored procedures

Hi. Im searching for a very high performant possibility to insert data into a MS SQL database. The data is a (relatively big) construct of objects with relations. For security reasons i want to use stored procedures instead of direct table access. Lets say i have a structure like this: Document MetaData User Device Content Conten...

Is it possible to update one Firebird database from a trigger in another Firebird database?

I have two firebird databases running on the same server and I want to write to a table on one of the databases from a trigger on the other database when certain actions occur. I have had a search and cannot find out if this is possible. Can it be done either natively in firebird or via a UDF? Thanks Neil ...